Interface ICommandHandler<TCommand, TResult>
interface to be implemented by a command handler for a given command type that returns a result
Namespace: FastEndpoints
Assembly: FastEndpoints.dll
Syntax
public interface ICommandHandler<in TCommand, TResult> : ICommandHandler where TCommand : ICommand<TResult>
Type Parameters
Name | Description |
---|---|
TCommand | the type of the input command |
TResult | the type of the result returned |
Methods
ExecuteAsync(TCommand, CancellationToken)
accepts a command and returns a result.
Declaration
Task<TResult> ExecuteAsync(TCommand command, CancellationToken ct = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
TCommand | command | the input command object |
System.Threading.CancellationToken | ct | optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<TResult> |