public OnActionExecuting ( System actionContext ) : void | ||
actionContext | System | The action context. |
return | 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);
}
}