EndpointExtensions.InTransactionAsync<TResponse> method
Executes a callback by passing a unit of work object asynchronously and converts any exception raised inside to a service response.
public static Task<Result<TResponse>> InTransactionAsync<TResponse>(this ControllerBase controller,
string connectionKey, Func<IUnitOfWork, CancellationToken, Task<TResponse>> handler,
CancellationToken cancellationToken = default)
where TResponse : ServiceResponse, new()
| parameter | description |
|---|---|
| TResponse | The response type. |
| controller | The controller. |
| connectionKey | The connection key. |
| handler | The handler callback. |
| cancellationToken | Cancellation token. |
Return Value
The action result.
See Also
- class Result<TResponse>
- interface IUnitOfWork
- class ServiceResponse
- class EndpointExtensions