Class RequestPreProcessorBehavior<TRequest, TResponse>
Runs every registered IRequestPreProcessor<TRequest> before the handler.
Registered automatically by AddCaesar when at least one pre-processor exists.
public sealed class RequestPreProcessorBehavior<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse> where TRequest : notnull
Type Parameters
TRequestThe request type.
TResponseThe response type.
- Inheritance
-
RequestPreProcessorBehavior<TRequest, TResponse>
- Implements
-
IPipelineBehavior<TRequest, TResponse>
- Inherited Members
Constructors
RequestPreProcessorBehavior(IEnumerable<IRequestPreProcessor<TRequest>>)
Creates the behavior.
public RequestPreProcessorBehavior(IEnumerable<IRequestPreProcessor<TRequest>> preProcessors)
Parameters
preProcessorsIEnumerable<IRequestPreProcessor<TRequest>>The pre-processors to run, in registration order.
Methods
Handle(TRequest, RequestHandlerDelegate<TResponse>, CancellationToken)
Handles the request, calling next to continue the pipeline.
public 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>