BetterValidation.ActionFilters.ValidationResponseFilter.OnActionExecuting C# (CSharp) Метод

OnActionExecuting() публичный Метод

Called when [action executing].
public OnActionExecuting ( System actionContext ) : void
actionContext System The action context.
Результат void
        public override void OnActionExecuting(System.Web.Http.Controllers.HttpActionContext actionContext)
        {
            if (!actionContext.ModelState.IsValid)
            {
                //actionContext.ModelState.Keys
                actionContext.Response = actionContext
                        .Request
                        .CreateErrorResponse(HttpStatusCode.BadRequest, actionContext.ModelState);
            }
        }
ValidationResponseFilter