Search Results for

    Show / Hide Table of Contents

    Class ProblemDetails

    RFC7807 compatible problem details/ error response class. this can be used by configuring startup like so:

    app.UseFastEndpoints(c => c.Errors.UseProblemDetails())
    Inheritance
    object
    ProblemDetails
    Implements
    IResult
    IEndpointMetadataProvider
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: FastEndpoints
    Assembly: FastEndpoints.dll
    Syntax
    public sealed class ProblemDetails : IResult, IEndpointMetadataProvider

    Constructors

    ProblemDetails()

    Declaration
    public ProblemDetails()

    ProblemDetails(IReadOnlyList<ValidationFailure>, int?)

    Declaration
    public ProblemDetails(IReadOnlyList<ValidationFailure> failures, int? statusCode = null)
    Parameters
    Type Name Description
    IReadOnlyList<ValidationFailure> failures
    int? statusCode

    ProblemDetails(IReadOnlyList<ValidationFailure>, string, string, int)

    Declaration
    public ProblemDetails(IReadOnlyList<ValidationFailure> failures, string instance, string traceId, int statusCode)
    Parameters
    Type Name Description
    IReadOnlyList<ValidationFailure> failures
    string instance
    string traceId
    int statusCode

    Properties

    Detail

    the details of the error

    Declaration
    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
    public string? Detail { get; set; }
    Property Value
    Type Description
    string

    Errors

    Declaration
    public IEnumerable<ProblemDetails.Error> Errors { get; set; }
    Property Value
    Type Description
    IEnumerable<ProblemDetails.Error>

    Instance

    Declaration
    public string Instance { get; set; }
    Property Value
    Type Description
    string

    Status

    Declaration
    public int Status { get; set; }
    Property Value
    Type Description
    int

    Title

    Declaration
    public string Title { get; }
    Property Value
    Type Description
    string

    TraceId

    Declaration
    public string TraceId { get; set; }
    Property Value
    Type Description
    string

    Type

    Declaration
    public string Type { get; }
    Property Value
    Type Description
    string

    Methods

    ExecuteAsync(HttpContext)

    Write an HTTP response reflecting the result.

    Declaration
    public Task ExecuteAsync(HttpContext httpContext)
    Parameters
    Type Name Description
    HttpContext httpContext

    The HttpContext for the current request.

    Returns
    Type Description
    Task

    A task that represents the asynchronous execute operation.

    PopulateMetadata(MethodInfo, EndpointBuilder)

    Populates metadata for the related Endpoint and MethodInfo.

    Declaration
    public static void PopulateMetadata(MethodInfo _, EndpointBuilder builder)
    Parameters
    Type Name Description
    MethodInfo _
    EndpointBuilder builder

    The EndpointBuilder used to construct the endpoint for the given method.

    Remarks

    This method is called by RequestDelegateFactory when creating a RequestDelegate and by MVC when creating endpoints for controller actions. This is called for each parameter and return type of the route handler or action with a declared type implementing this interface. Add or remove objects on the Metadata property of the builder to modify the Metadata being built.

    Implements

    IResult
    IEndpointMetadataProvider
    In this article
    Back to top Developed by Đĵ ΝιΓΞΗΛψΚ and contributors / Licensed under MIT / Website generated by DocFX