Class ResultMappingExtensions
- Namespace
- Olve.MinimalApi
- Assembly
- Olve.MinimalApi.dll
public static class ResultMappingExtensions
- Inheritance
-
ResultMappingExtensions
- Inherited Members
Methods
ToHttpResult(Result)
public static IResult ToHttpResult(this Result result)
Parameters
Returns
ToHttpResult<T>(Result<T>)
public static IResult ToHttpResult<T>(this Result<T> result)
Parameters
Returns
- IResult
An IResult representing the HTTP response, either OK with value or BadRequest with problems.
Type Parameters
TThe type of the result value.
WithResultMapping(RouteHandlerBuilder)
Configures the endpoint to produce success and error HTTP responses based on Result.
public static RouteHandlerBuilder WithResultMapping(this RouteHandlerBuilder builder)
Parameters
builderRouteHandlerBuilderThe route handler builder to configure.
Returns
- RouteHandlerBuilder
The configured RouteHandlerBuilder.
WithResultMapping<TResult>(RouteHandlerBuilder)
Configures the endpoint to produce success and error HTTP responses based on Result<T>.
public static RouteHandlerBuilder WithResultMapping<TResult>(this RouteHandlerBuilder builder)
Parameters
builderRouteHandlerBuilderThe route handler builder to configure.
Returns
- RouteHandlerBuilder
The configured RouteHandlerBuilder.
Type Parameters
TResultThe type of the result value.