Interface IHandler<TRequest, TResponse>
- Namespace
- Olve.MinimalApi
- Assembly
- Olve.MinimalApi.dll
Defines a handler for processing requests of type TRequest returning response of type TResponse.
public interface IHandler<in TRequest, TResponse>
Type Parameters
TRequestThe type of request to handle.
TResponseThe type of response returned by the handler.
Methods
HandleAsync(TRequest, CancellationToken)
Handles the request asynchronously and returns a Result<T> containing the response or errors.
Task<Result<TResponse>> HandleAsync(TRequest request, CancellationToken cancellationToken)
Parameters
requestTRequestThe request to handle.
cancellationTokenCancellationTokenToken to cancel operation.