public UpdateTodoItemCommand(int parentId, int id, ViewModel.TodoItem.UpdateView updateView) { _parentId = parentId; _id = id; UpdateView = updateView; }
public async Task <IActionResult> UpdateTodoItem(int parentId, int id, [FromBody] ViewModel.TodoItem.UpdateView toUpdate) { var result = await _handler.HandleCommand <UpdateTodoItemCommand, UpdateTodoItemCommandResult>( new UpdateTodoItemCommand(parentId, id, toUpdate)); if (!result.Successfull) { return(StatusCode(StatusCodes.Status500InternalServerError)); } return(Ok(result.Data)); }