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
Detail
Declaration
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Detail { get; set; }
Property Value
Errors
Declaration
public IEnumerable<ProblemDetails.Error> Errors { get; set; }
Property Value
Instance
Declaration
public string Instance { get; set; }
Property Value
Status
Declaration
public int Status { get; set; }
Property Value
Title
Declaration
public string Title { get; }
Property Value
TraceId
Declaration
public string TraceId { get; set; }
Property Value
Type
Declaration
public string Type { get; }
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