Table of Contents

Class LoggingBehavior<TRequest, TResponse>

Namespace
KadicAuth.Application.Behaviors
Assembly
KadicAuth.Application.dll
public class LoggingBehavior<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse> where TRequest : IRequest<TResponse>

Type Parameters

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

Constructors

LoggingBehavior(ILogger<LoggingBehavior<TRequest, TResponse>>)

public LoggingBehavior(ILogger<LoggingBehavior<TRequest, TResponse>> logger)

Parameters

logger ILogger<LoggingBehavior<TRequest, TResponse>>

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