Class LoggingBehavior<TRequest, TResponse>
It wraps the request generated logs, the handling request log will have the request params and handled request log will have the response.
Implements
IPipelineBehavior<TRequest, TResponse>
Inherited Members
Namespace: Code.Library.Application.Behaviors
Assembly: Code.Library.Application.dll
Syntax
public class LoggingBehavior<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse> where TRequest : IRequest<TResponse>
Type Parameters
| Name | Description |
|---|---|
| TRequest | |
| TResponse |
Remarks
Constructors
| Improve this Doc View SourceLoggingBehavior(ILogger<LoggingBehavior<TRequest, TResponse>>)
It wraps the request generated logs, the handling request log will have the request params and handled request log will have the response.
Declaration
public LoggingBehavior(ILogger<LoggingBehavior<TRequest, TResponse>> logger)
Parameters
| Type | Name | Description |
|---|---|---|
| ILogger<LoggingBehavior<TRequest, TResponse>> | logger |
Remarks
Methods
| Improve this Doc View SourceHandle(TRequest, CancellationToken, RequestHandlerDelegate<TResponse>)
It wraps the request generated logs, the handling request log will have the request params and handled request log will have the response.
Declaration
public Task<TResponse> Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate<TResponse> next)
Parameters
| Type | Name | Description |
|---|---|---|
| TRequest | request | |
| CancellationToken | cancellationToken | |
| RequestHandlerDelegate<TResponse> | next |
Returns
| Type | Description |
|---|---|
| Task<TResponse> |
Remarks
Implements
MediatR.IPipelineBehavior<TRequest, TResponse>