Class CommandHandler<TCommand, TResult>
inherit this base class if you'd like to manipulate validation state of the calling endpoint from within the command handler.
Inheritance
ValidationContext<TCommand>
CommandHandlerBase<TCommand>
CommandHandler<TCommand, TResult>
Inherited Members
Namespace: FastEndpoints
Assembly: FastEndpoints.dll
Syntax
public abstract class CommandHandler<TCommand, TResult> : CommandHandlerBase<TCommand>, ICommandHandler<TCommand, TResult>, ICommandHandler where TCommand : ICommand<TResult>
Type Parameters
| Name | Description |
|---|---|
| TCommand | the type of the command that will be handled by this command handler |
| TResult | the type of the result that will be returned by this command handler |
Methods
ExecuteAsync(TCommand, CancellationToken)
receives a command and returns a result.
Declaration
public abstract Task<TResult> ExecuteAsync(TCommand command, CancellationToken ct = default)
Parameters
| Type | Name | Description |
|---|---|---|
| TCommand | command | the input command object |
| CancellationToken | ct | optional cancellation token |
Returns
| Type | Description |
|---|---|
| Task<TResult> |