Esempio n. 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(),
     });
 }
Esempio n. 2
0
 public async Task Execute(ICommandExecutionContext context)
 {
     await context.GetEventService().Raise(new ErrorLoggedEvent
     {
         Message     = this.Message,
         AggregateId = context.GetIdGenerator().GenerateId(),
         Description = this.Description,
     });
 }
Esempio n. 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,
            });
        }