Class ValidateModelAttribute.ValidateModelFilter
Action filter created by ValidateModelAttribute via TypeFilterAttribute.
Short-circuits the pipeline with 400 Bad Request when IsValid is false,
returning the full ModelStateDictionary as the response body.
Inherited Members
Namespace: DataWeb.Filter
Assembly: DataWeb.Core.dll
Syntax
public class ValidateModelAttribute.ValidateModelFilter : IAsyncActionFilter, IFilterMetadata
Methods
OnActionExecutionAsync(ActionExecutingContext, ActionExecutionDelegate)
Validates the model state before the action executes.
Aborts the pipeline with 400 Bad Request if the model is invalid;
otherwise forwards execution to the next filter or action.
Declaration
public Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
Parameters
| Type | Name | Description |
|---|---|---|
| ActionExecutingContext | context | The ActionExecutingContext for the current request. |
| ActionExecutionDelegate | next | The delegate to invoke to continue the action execution pipeline. |
Returns
| Type | Description |
|---|---|
| Task | A Task representing the asynchronous operation. |