Class TrackChangeCommandBehavior<TEntityModel, TResponse>
- Namespace
- Arbiter.CommandQuery.Behaviors
- Assembly
- Arbiter.CommandQuery.dll
A behavior for tracking the changes of a model.
public class TrackChangeCommandBehavior<TEntityModel, TResponse> : PipelineBehaviorBase<EntityModelCommand<TEntityModel, TResponse>, TResponse>, IPipelineBehavior<EntityModelCommand<TEntityModel, TResponse>, TResponse> where TEntityModel : class
Type Parameters
TEntityModel
The type of the model
TResponse
The type of the response
- Inheritance
-
PipelineBehaviorBase<EntityModelCommand<TEntityModel, TResponse>, TResponse>TrackChangeCommandBehavior<TEntityModel, TResponse>
- Implements
-
IPipelineBehavior<EntityModelCommand<TEntityModel, TResponse>, TResponse>
- Inherited Members
Constructors
TrackChangeCommandBehavior(ILoggerFactory, IPrincipalReader)
Initializes a new instance of the TrackChangeCommandBehavior<TEntityModel, TResponse> class.
public TrackChangeCommandBehavior(ILoggerFactory loggerFactory, IPrincipalReader principalReader)
Parameters
loggerFactory
ILoggerFactoryThe logger factory to create an ILogger from
principalReader
IPrincipalReaderThe claims principal reader service.
Methods
Process(EntityModelCommand<TEntityModel, TResponse>, RequestHandlerDelegate<TResponse>, CancellationToken)
Processes the specified request with the additional behavior.
protected override ValueTask<TResponse?> Process(EntityModelCommand<TEntityModel, TResponse> request, RequestHandlerDelegate<TResponse> next, CancellationToken cancellationToken)
Parameters
request
EntityModelCommand<TEntityModel, TResponse>The incoming request.
next
RequestHandlerDelegate<TResponse>Awaitable delegate for the next action in the pipeline. Eventually this delegate represents the handler.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- ValueTask<TResponse>
Awaitable task returning the
TResponse