public async Task <ICommandResult> HandleAsync(UpdateTodoItemTitle command) { var todoItem = await this._sessionRepository.GetAsync <TodoItem>(command.Id, command.Version); todoItem.UpdateTodoItemTitle(command.Title); await this._sessionRepository.CommitAsync(); return(new CommandResult(HttpStatusCode.OK, new { AggregateId = todoItem.Id, AggregateVersion = todoItem.Version })); }
public async Task <ICommandResult> UpdateTodoItemTitle(UpdateTodoItemTitle updateTodoItemTitle) { return(await _bus.SubmitAsync(updateTodoItemTitle)); }