public void Handle(EditToDoCommand message) { ExecuteDomainUpdate(message.AggregateId, aggregate => { aggregate.Edit(message.Title, message.Description); }); }
public async Task <ToDo.Domain.ToDo> Edit([FromBody] EditToDoCommand command) { var toDo = await _toDoContext.ToDo.Where(x => x.Id == command.Id && x.Arch == false).FirstOrDefaultAsync(); toDo.DueDate = command.DueDate; toDo.Note = command.Note; toDo.UserId = command.UserId; toDo.Title = command.Title; await _toDoContext.SaveChangesAsync(); return(toDo); }