Class ActorResourceViaCommandHandler<TCommand, TLeaf, TOwner, TResponse>
Supplies the checked actor and loaded leaf, not its authorization owners, to command business logic.
public abstract class ActorResourceViaCommandHandler<TCommand, TLeaf, TOwner, TResponse> : ICommandHandler<TCommand, TResponse> where TCommand : ICommand<TResponse>, IAuthorizeResourceVia<TOwner> where TLeaf : class where TResponse : IResult, IFailureFactory<TResponse>
Type Parameters
TCommandAn indirectly resource-authorized command; static permissions are optional.
TLeafThe reference-type leaf identified by the command and loaded by the pipeline.
TOwnerThe authorization target type at the end of the registered path.
TResponseA result-compatible response.
- Inheritance
-
ActorResourceViaCommandHandler<TCommand, TLeaf, TOwner, 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, TLeaf, CancellationToken)
Executes command business logic with the exact checked actor and loaded leaf.
protected abstract ValueTask<TResponse> Handle(TCommand command, Actor actor, TLeaf leaf, CancellationToken cancellationToken)
Parameters
commandTCommandThe command to handle.
actorActorThe actor checked against the owner resources.
leafTLeafThe same leaf loaded by this dispatch, not its owner resources.
cancellationTokenCancellationTokenThe dispatch cancellation token.
Returns
- ValueTask<TResponse>
The business outcome.