Example #1
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(),
     });
 }
Example #2
0
 public async Task Execute(ICommandExecutionContext context)
 {
     await context.GetEventService().Raise(new ErrorLoggedEvent
     {
         Message     = this.Message,
         AggregateId = context.GetIdGenerator().GenerateId(),
         Description = this.Description,
     });
 }
Example #3
0
        public async Task Execute(ICommandExecutionContext context)
        {
            var list = await this.TodoLists.GetById(this.TodoListId);

            this.Result = await context.GetEventService().Raise(new TodoCreatedEvent
            {
                AggregateId  = context.GetIdGenerator().GenerateId(),
                Text         = this.Text,
                TodoListId   = list.Id,
                TodoListName = list.Name,
            });
        }