a guest Aug 14th, 2019 38 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- public class ModelStateFilter : ActionFilterAttribute
- public override void OnActionExecuting(ActionExecutingContext context)
- if (!context.ModelState.IsValid)
- context.Result = new BadRequestObjectResult(new
- Error = "My custom error message"
RAW Paste Data