コード例 #1
0
 public async Task Execute(ICommandExecutionContext context)
 {
     await context.GetEventService().Raise(new Published
     {
         AggregateId     = this.PostId,
         PublicationDate = context.GetTimeService().Now(),
     });
 }
コード例 #2
0
 public async Task Execute(ICommandExecutionContext context)
 {
     this.Result = await context.GetEventService().Raise(new TodoListCreatedEvent
     {
         AggregateId = context.GetIdGenerator().GenerateId(),
         Name        = this.Name,
         Date        = context.GetTimeService().Now(),
     });
 }
コード例 #3
0
 public async Task Execute(RegisterUserCommand command, ICommandExecutionContext context)
 {
     await context.GetEventService().Raise(new Registered
     {
         AggregateId      = command.Username,
         EmailAddress     = command.EmailAddress,
         RegistrationDate = context.GetTimeService().Now(),
     });
 }