示例#1
0
 /// <summary>
 /// Schedules a constructor command on the specified scheduler.
 /// </summary>
 public static async Task <IScheduledCommand <TTarget> > Schedule <TTarget>(
     this ICommandScheduler <TTarget> scheduler,
     ConstructorCommand <TTarget> command,
     DateTimeOffset?dueTime          = null,
     IPrecondition deliveryDependsOn = null,
     IClock clock = null)
     where TTarget : class
 {
     return(await scheduler.Schedule(
                command : command,
                targetId : command.AggregateId.ToString(),
                dueTime : dueTime,
                deliveryDependsOn : deliveryDependsOn,
                clock : clock));
 }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EventSourcedAggregate{T}"/> class by applying the specified command.
 /// </summary>
 /// <param name="createCommand">The create command.</param>
 protected EventSourcedAggregate(ConstructorCommand <T> createCommand) : base(createCommand.AggregateId)
 {
     createCommand.ApplyTo((dynamic)this);
 }