Class ActorResourceCommandHandler<TCommand, TResource, TResponse>
Supplies the checked actor and directly authorized resource to command business logic.
public abstract class ActorResourceCommandHandler<TCommand, TResource, TResponse> : ICommandHandler<TCommand, TResponse> where TCommand : ICommand<TResponse>, IAuthorizeResource<TResource> where TResource : class where TResponse : IResult, IFailureFactory<TResponse>
Type Parameters
TCommandA directly resource-authorized command; static permissions are optional.
TResourceThe reference-type resource loaded by the pipeline.
TResponseA result-compatible response.
- Inheritance
-
ActorResourceCommandHandler<TCommand, TResource, 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, TResource, CancellationToken)
Executes command business logic with the exact checked actor and loaded resource.
protected abstract ValueTask<TResponse> Handle(TCommand command, Actor actor, TResource resource, CancellationToken cancellationToken)
Parameters
commandTCommandThe command to handle.
actorActorThe actor checked by this dispatch.
resourceTResourceThe same resource instance loaded and authorized by this dispatch.
cancellationTokenCancellationTokenThe dispatch cancellation token.
Returns
- ValueTask<TResponse>
The business outcome.