DataWeb
Search Results for

    Show / Hide Table of Contents

    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.

    Inheritance
    object
    ValidateModelAttribute.ValidateModelFilter
    Implements
    IAsyncActionFilter
    IFilterMetadata
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    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.

    Implements

    IAsyncActionFilter
    IFilterMetadata
    In this article
    Back to top Generated by DocFX