コード例 #1
0
 public void Handle(EditToDoCommand message)
 {
     ExecuteDomainUpdate(message.AggregateId, aggregate =>
     {
         aggregate.Edit(message.Title, message.Description);
     });
 }
コード例 #2
0
        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);
        }