Interface IFrameworkCommandDispatcher
Base interface for command dispatch. Most people should use the derived ICommandDispatcher interface. This interface is primarily intended to allow decorators to be built with IoC containers that require a build step.
If a deferred dispatcher is not registered then the command will also be run at the point of dispatch.
This allows for configuration based behaviour modification.
Namespace: AzureFromTheTrenches.Commanding.Abstractions
Assembly: AzureFromTheTrenches.Commanding.Abstractions.dll
Syntax
public interface IFrameworkCommandDispatcher
Properties
| Improve this Doc View SourceAssociatedExecuter
The dispatchers associated executer
Declaration
ICommandExecuter AssociatedExecuter { get; }
Property Value
| Type | Description |
|---|---|
| ICommandExecuter |
Methods
| Improve this Doc View SourceDispatchAsync(ICommand, CancellationToken)
Dispatches a command with no expected payload result
Declaration
Task<CommandResult> DispatchAsync(ICommand command, CancellationToken cancellationToken = default(CancellationToken))
Parameters
| Type | Name | Description |
|---|---|---|
| ICommand | command | The command |
| System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<CommandResult> | Command result |
DispatchAsync<TResult>(ICommand<TResult>, CancellationToken)
Dispatches a command and returns the response
Declaration
Task<CommandResult<TResult>> DispatchAsync<TResult>(ICommand<TResult> command, CancellationToken cancellationToken = default(CancellationToken))
Parameters
| Type | Name | Description |
|---|---|---|
| ICommand<TResult> | command | The command |
| System.Threading.CancellationToken | cancellationToken | Optional cancellation token |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<CommandResult<TResult>> | Command result |
Type Parameters
| Name | Description |
|---|---|
| TResult | Result of the command |