Show / Hide Table of Contents

Class ValidationBehavior<TRequest, TResponse>

Валидация перед хэндлерами CQRS command/query

Inheritance
object
ValidationBehavior<TRequest, TResponse>
Implements
IPipelineBehavior<TRequest, TResponse>
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: NotifyHub.NotificationService.Infrastructure.Behaviours
Assembly: NotifyHub.NotificationService.Infrastructure.dll
Syntax
public class ValidationBehavior<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse> where TRequest : notnull
Type Parameters
Name Description
TRequest
TResponse

Constructors

| Edit this page View Source

ValidationBehavior(IEnumerable<IValidator<TRequest>>)

Declaration
public ValidationBehavior(IEnumerable<IValidator<TRequest>> validators)
Parameters
Type Name Description
IEnumerable<IValidator<TRequest>> validators

Methods

| Edit this page View Source

Handle(TRequest, RequestHandlerDelegate<TResponse>, CancellationToken)

Pipeline handler. Perform any additional behavior and await the next delegate as necessary

Declaration
public Task<TResponse> Handle(TRequest request, RequestHandlerDelegate<TResponse> next, CancellationToken cancellationToken)
Parameters
Type Name Description
TRequest request

Incoming request

RequestHandlerDelegate<TResponse> next

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

CancellationToken cancellationToken

Cancellation token

Returns
Type Description
Task<TResponse>

Awaitable task returning the TResponse

Implements

MediatR.IPipelineBehavior<TRequest, TResponse>
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX