Namespace Cqrs.Commands
Classes
DtoCommand<TAuthenticationToken, TDto>
A ICommand<TAuthenticationToken> for IDto objects
DtoCommandHandler<TAuthenticationToken, TDto>
A ICommandHandle for working with DtoCommand<TAuthenticationToken, TDto>.
Interfaces
ICommand<TAuthenticationToken>
People request changes to the domain by sending ICommand<TAuthenticationToken>s. They are named with a verb in the imperative mood plus and may include the IAggregateRoot<TAuthenticationToken> type, for example ConfirmOrder. Unlike an IEvent<TAuthenticationToken>, a ICommand<TAuthenticationToken> is not a statement of fact; it's only a request, and thus may be refused. (A typical way to convey refusal is to raise a specifically typed IEvent<TAuthenticationToken> stating the ICommand<TAuthenticationToken> didn't happen for a specific reason).
ICommandHandle
An ICommandHandler<TAuthenticationToken, TCommand> receives an ICommand<TAuthenticationToken> and brokers a result from the appropriate IAggregateRoot<TAuthenticationToken>. "A result" is either a successful application of the command, or an exception. This is the common sequence of steps an ICommandHandler<TAuthenticationToken, TCommand> might follow:
Validate the ICommand<TAuthenticationToken> on its own merits. Ask an IAggregateRoot<TAuthenticationToken> to handle the ICommand<TAuthenticationToken>. If validation is successful, 0..n IEvent<TAuthenticationToken> artefacts (1 is common) are queued for publishing. Attempt to persist the new IEvent<TAuthenticationToken> artefacts. If there's a concurrency conflict during this step, either give up, or retry things. Dispatch the queued IEvent<TAuthenticationToken> artefacts.
ICommandHandler<TAuthenticationToken, TCommand>
An ICommandHandler<TAuthenticationToken, TCommand> receives an ICommand<TAuthenticationToken> and brokers a result from the appropriate IAggregateRoot<TAuthenticationToken>. "A result" is either a successful application of the command, or an exception. This is the common sequence of steps an ICommandHandler<TAuthenticationToken, TCommand> might follow:
Validate the ICommand<TAuthenticationToken> on its own merits. Ask an IAggregateRoot<TAuthenticationToken> to handle the ICommand<TAuthenticationToken>. If validation is successful, 0..n IEvent<TAuthenticationToken> artefacts (1 is common) are queued for publishing. Attempt to persist the new IEvent<TAuthenticationToken> artefacts. If there's a concurrency conflict during this step, either give up, or retry things. Dispatch the queued IEvent<TAuthenticationToken> artefacts.
ICommandPublisher<TAuthenticationToken>
Publishes an ICommand<TAuthenticationToken>
ICommandReceiver
Receives instances of a ICommand<TAuthenticationToken> from the command bus.
ICommandReceiver<TAuthenticationToken>
Receives instances of a ICommand<TAuthenticationToken> from the command bus.
ICommandSender<TAuthenticationToken>
Sends an ICommand<TAuthenticationToken>
ICommandValidator<TAuthenticationToken, TCommand>
Validates an ICommand<TAuthenticationToken> on its own merits.
IPublishAndWaitCommandPublisher<TAuthenticationToken>
Publishes an ICommand<TAuthenticationToken>
ISendAndWaitCommandSender<TAuthenticationToken>
Sends an ICommand<TAuthenticationToken>