Class ActorCommandHandler<TCommand, TResponse>
Supplies the dispatch's authorized actor to command business logic.
public abstract class ActorCommandHandler<TCommand, TResponse> : ICommandHandler<TCommand, TResponse> where TCommand : ICommand<TResponse>, IAuthorizationMessage where TResponse : IResult, IFailureFactory<TResponse>
Type Parameters
TCommandAn authorization-marked command.
TResponseA result-compatible response.
- Inheritance
-
ActorCommandHandler<TCommand, TResponse>
- Implements
-
ICommandHandler<TCommand, TResponse>
- Inherited Members
- Extension Methods
Methods
Handle(TCommand, CancellationToken)
public ValueTask<TResponse> Handle(TCommand command, CancellationToken cancellationToken)
Parameters
commandTCommandcancellationTokenCancellationToken
Returns
- ValueTask<TResponse>
Handle(TCommand, Actor, CancellationToken)
Executes command business logic using the supplied authorized actor.
protected abstract ValueTask<TResponse> Handle(TCommand command, Actor actor, CancellationToken cancellationToken)
Parameters
commandTCommandThe command to handle.
actorActorThe actor checked by this dispatch's authorization stages.
cancellationTokenCancellationTokenThe dispatch cancellation token.
Returns
- ValueTask<TResponse>
The business outcome.