Table of Contents

Class ActorResourceViaCommandHandler<TCommand, TLeaf, TOwner, TResponse>

Namespace
Trellis.Mediator
Assembly
Trellis.Mediator.dll

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

TCommand

An indirectly resource-authorized command; static permissions are optional.

TLeaf

The reference-type leaf identified by the command and loaded by the pipeline.

TOwner

The authorization target type at the end of the registered path.

TResponse

A 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

command TCommand
cancellationToken CancellationToken

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

command TCommand

The command to handle.

actor Actor

The actor checked against the owner resources.

leaf TLeaf

The same leaf loaded by this dispatch, not its owner resources.

cancellationToken CancellationToken

The dispatch cancellation token.

Returns

ValueTask<TResponse>

The business outcome.