EndpointExtensions.InTransaction<TResponse> method
Executes a callback by passing a unit of work object and converts any exception raised inside to a service response.
public static Result<TResponse> InTransaction<TResponse>(this ControllerBase controller,
string connectionKey, Func<IUnitOfWork, 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>
- interface IUnitOfWork
- class ServiceResponse
- class EndpointExtensions