Table of Contents

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

TRequest
TResponse
Inheritance
object
ValidationBehavior<TRequest, TResponse>
Implements
IPipelineBehavior<TRequest, TResponse>

Constructors

ValidationBehavior(IEnumerable<IValidator<TRequest>>)

public ValidationBehavior(IEnumerable<IValidator<TRequest>> validators)

Parameters

validators IEnumerable<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

request TRequest

Incoming request

next RequestHandlerDelegate<TResponse>

Awaitable delegate for the next action in the pipeline. Eventually this delegate represents the handler.

cancellationToken CancellationToken

Cancellation token

Returns

Task<TResponse>

Awaitable task returning the TResponse