Search Results for

    Show / Hide Table of Contents

    Class ErrorOptions

    error response customization settings

    Inheritance
    System.Object
    ErrorOptions
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: FastEndpoints
    Assembly: FastEndpoints.dll
    Syntax
    public class ErrorOptions

    Properties

    GeneralErrorsField

    the general errors field name. this is the field name used for general errors when AddError() method is called without specifying a request dto property.

    Declaration
    public string GeneralErrorsField { set; }
    Property Value
    Type Description
    System.String

    ProducesMetadataType

    if this property is set, a Microsoft.AspNetCore.Http.Metadata.IProducesResponseTypeMetadata will automatically be added to any endpoints that has a Validator<TRequest> associated with it. if you're not specifying your own ResponseBuilder, you'd typically be setting this to typeOf(ErrorResponse)

    Declaration
    public Type ProducesMetadataType { set; }
    Property Value
    Type Description
    System.Type

    ResponseBuilder

    a function for transforming validation errors to an error response dto. set it to any func that returns an object that can be serialized to json. this function will be run everytime an error response needs to be sent to the client. the arguments for the func will be a list of validation failures, the http context and an http status code.

    Declaration
    public Func<List<ValidationFailure>, HttpContext, int, object> ResponseBuilder { set; }
    Property Value
    Type Description
    System.Func<System.Collections.Generic.List<FluentValidation.Results.ValidationFailure>, Microsoft.AspNetCore.Http.HttpContext, System.Int32, System.Object>

    StatusCode

    this http status code will be used for all automatically sent validation failure responses. defaults to 400.

    Declaration
    public int StatusCode { set; }
    Property Value
    Type Description
    System.Int32
    In This Article
    Back to top Developed by Đĵ ΝιΓΞΗΛψΚ and contributors / Licensed under MIT / Website generated by DocFX