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
TRequestTResponse
- Inheritance
-
objectLoggingBehavior<TRequest, TResponse>
- Implements
-
IPipelineBehavior<TRequest, TResponse>
Constructors
LoggingBehavior(ILogger<LoggingBehavior<TRequest, TResponse>>)
public LoggingBehavior(ILogger<LoggingBehavior<TRequest, TResponse>> logger)
Parameters
loggerILogger<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
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