EndpointExtensions.UseConnection<TResponse> method
Executes a callback by passing a connection object and converts any exception raised inside to a service response.
public static Result<TResponse> UseConnection<TResponse>(this ControllerBase controller,
string connectionKey, Func<IDbConnection, TResponse> handler)
where TResponse : ServiceResponse, new()
| parameter | description |
|---|---|
| TResponse | The response type. |
| controller | The controller. |
| connectionKey | The connection key. |
| handler | The handler callback. |
Return Value
The action result.
See Also
- class Result<TResponse>
- class ServiceResponse
- class EndpointExtensions