Interface IPipelineBehavior<TRequest, TResponse>
- Namespace
- Caesar
- Assembly
- Caesar.Abstractions.dll
Wraps the handling of a request. Behaviors are executed in registration order and form a Russian-doll chain around the IRequestHandler<TRequest, TResponse>. Register an open-generic behavior to apply it to every request.
public interface IPipelineBehavior<in TRequest, TResponse> where TRequest : notnull
Type Parameters
TRequestThe request type.
TResponseThe response type.
Methods
Handle(TRequest, RequestHandlerDelegate<TResponse>, CancellationToken)
Handles the request, calling next to continue the pipeline.
Task<TResponse> Handle(TRequest request, RequestHandlerDelegate<TResponse> next, CancellationToken cancellationToken)
Parameters
requestTRequestThe request.
nextRequestHandlerDelegate<TResponse>Continues the pipeline. Not calling it short-circuits the request.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<TResponse>