Table of Contents

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

TRequest

The type of request to handle.

TResponse

The 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

request TRequest

The request to handle.

cancellationToken CancellationToken

Token to cancel operation.

Returns

Task<Result<TResponse>>

A Result<T> with the operation result or failures.