Class ProblemDetails
RFC7807 compatible problem details/ error response class. this can be used by configuring startup like so:
app.UseFastEndpoints(x => x.Errors.ResponseBuilder = ProblemDetails.ResponseBuilder);
Inheritance
ProblemDetails
Assembly: FastEndpoints.dll
Syntax
public sealed class ProblemDetails : IResult
Constructors
ProblemDetails()
Declaration
ProblemDetails(IReadOnlyList<ValidationFailure>, int?)
Declaration
public ProblemDetails(IReadOnlyList<ValidationFailure> failures, int? statusCode = null)
Parameters
ProblemDetails(IReadOnlyList<ValidationFailure>, string, string, int)
Declaration
public ProblemDetails(IReadOnlyList<ValidationFailure> failures, string instance, string traceId, int statusCode)
Parameters
Properties
AllowDuplicates
controls whether duplicate errors with the same name should be allowed.
Declaration
public static bool AllowDuplicates { set; }
Property Value
Errors
Declaration
public IEnumerable<ProblemDetails.Error> Errors { get; set; }
Property Value
Instance
Declaration
public string Instance { get; set; }
Property Value
ResponseBuilder
the built-in function for transforming validation errors to a RFC7807 compatible problem details error response dto.
Declaration
public static Func<List<ValidationFailure>, HttpContext, int, object> ResponseBuilder { get; }
Property Value
Status
Declaration
public int Status { get; set; }
Property Value
Title
Declaration
public string Title { get; }
Property Value
TitleValue
globally sets the 'Title' value of the problem details dto.
Declaration
public static string TitleValue { set; }
Property Value
TraceId
Declaration
public string TraceId { get; set; }
Property Value
Type
Declaration
public string Type { get; }
Property Value
TypeValue
globally sets the 'Type' value of the problem details dto.
Declaration
public static string TypeValue { set; }
Property Value
Methods
ExecuteAsync(HttpContext)
Write an HTTP response reflecting the result.
Declaration
public Task ExecuteAsync(HttpContext httpContext)
Parameters
Returns
Type |
Description |
Task |
A task that represents the asynchronous execute operation.
|
Implements