Table of Contents

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

TRequest

The request type.

TResponse

The 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

request TRequest

The request.

next RequestHandlerDelegate<TResponse>

Continues the pipeline. Not calling it short-circuits the request.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<TResponse>