public async Task Deliver(IScheduledCommand <TAggregate> scheduledCommand) { using (CommandContext.Establish(scheduledCommand.Command)) { await repository.ApplyScheduledCommand(scheduledCommand); } }
/// <summary> /// Delivers the specified scheduled command to the target aggregate. /// </summary> /// <param name="scheduledCommand">The scheduled command to be applied to the aggregate.</param> /// <returns> /// A task that is complete when the command has been applied. /// </returns> /// <remarks> /// The scheduler will apply the command and save it, potentially triggering additional consequences. /// </remarks> public virtual async Task Deliver(IScheduledCommand <TAggregate> scheduledCommand) { await repository.ApplyScheduledCommand(scheduledCommand, preconditionVerifier); }