Class RequestLoggingHandlingBehavior<TRequest, TResponse\>
Namespace: Common.Behaviors
Assembly: Common.dll
Type Parameters
TRequest
TResponse
Inheritance
object ← RequestLoggingHandlingBehavior<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\(\)
Constructors
RequestLoggingHandlingBehavior\(ILogger<RequestLoggingHandlingBehavior<TRequest, TResponse\>\>\)
Parameters
logger ILogger
Methods
Handle\(TRequest, RequestHandlerDelegate<TResponse\>, CancellationToken\)
Handles and processes the incoming request, logging the start and completion of the request. It also manages success and failure cases for requests that return a standard API response : LanguageExt.Common.Result%601. If the response is not of the expected type, a warning log message is generated.
Parameters
request TRequest
The incoming request object to be processed.
next RequestHandlerDelegate<TResponse\>
The next delegate in the request processing pipeline.
cancellationToken CancellationToken
A cancellation token that can be used to cancel the request processing.
Returns
Task <TResponse\>
A task that represents the asynchronous operation, with a result of type TResponse.