EndpointExtensions.ExecuteMethod<TResponse> method
Executes an action method and converts any exception to a service response.
public static Result<TResponse> ExecuteMethod<TResponse>(this ControllerBase controller,
Func<TResponse> handler)
where TResponse : ServiceResponse, new()
| parameter | description |
|---|---|
| TResponse | The response type. |
| controller | The controller. |
| handler | The handler callback. |
Return Value
The action result.
See Also
- class Result<TResponse>
- class ServiceResponse
- class EndpointExtensions