All Types / Ferrous.AspNetCore
class FerrousResultEndpointFilter
public sealed class FerrousResultEndpointFilter : IEndpointFilter
Minimal API IEndpointFilter that automatically unwraps Result<T, TError> and Option<T> return values into HTTP IResult responses (200 OK, 404 Not Found, or RFC 7807 ProblemDetails).
Constructors
public FerrousResultEndpointFilter(int defaultErrorStatusCode = StatusCodes.Status400BadRequest)
Initializes a new FerrousResultEndpointFilter.
Parameters
defaultErrorStatusCode- The HTTP status code emitted when an endpoint returns
Result.Err. Defaults to 400 Bad Request.
Methods
public async ValueTask<object?> InvokeAsync(EndpointFilterInvocationContext context, EndpointFilterDelegate next)