コード例 #1
0
        public UpdateTodoItemCommand(int parentId, int id, ViewModel.TodoItem.UpdateView updateView)
        {
            _parentId = parentId;
            _id       = id;

            UpdateView = updateView;
        }
コード例 #2
0
        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));
        }