Class ValidationBehavior<TRequest, TResponse>
- Namespace
- KadicAuth.Application.Behaviors
- Assembly
- KadicAuth.Application.dll
public class ValidationBehavior<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse> where TRequest : IRequest<TResponse>
Type Parameters
TRequestTResponse
- Inheritance
-
objectValidationBehavior<TRequest, TResponse>
- Implements
-
IPipelineBehavior<TRequest, TResponse>
Constructors
ValidationBehavior(IEnumerable<IValidator<TRequest>>)
public ValidationBehavior(IEnumerable<IValidator<TRequest>> validators)
Parameters
validatorsIEnumerable<IValidator<TRequest>>
Methods
Handle(TRequest, RequestHandlerDelegate<TResponse>, CancellationToken)
Pipeline handler. Perform any additional behavior and await the next delegate as necessary
public Task<TResponse> Handle(TRequest request, RequestHandlerDelegate<TResponse> next, CancellationToken cancellationToken)
Parameters
requestTRequestIncoming request
nextRequestHandlerDelegate<TResponse>Awaitable delegate for the next action in the pipeline. Eventually this delegate represents the handler.
cancellationTokenCancellationTokenCancellation token
Returns
- Task<TResponse>
Awaitable task returning the
TResponse