Table of Contents

Class ActorCommandHandler<TCommand, TResponse>

Namespace
Trellis.Mediator
Assembly
Trellis.Mediator.dll

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

TCommand

An authorization-marked command.

TResponse

A 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

command TCommand
cancellationToken CancellationToken

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

command TCommand

The command to handle.

actor Actor

The actor checked by this dispatch's authorization stages.

cancellationToken CancellationToken

The dispatch cancellation token.

Returns

ValueTask<TResponse>

The business outcome.