public IActionResult Put([FromRoute] TodoSearchVm search, [FromBody] TodoUpdateVm todo)
        {
            var result = _repository[search.Id];

            result.Update(todo.Description);

            _repository.Replace(result);

            return(NoContent());
        }
예제 #2
0
        // attribute for UPDATE METHOD
        public ActionResult Update(int Id)
        {
            TodoUpdateVm updateVm     = new TodoUpdateVm();
            Todo         itemToUpdate = _service.FetchATodo(Id);

            updateVm.Id          = itemToUpdate.Id;
            updateVm.Task        = itemToUpdate.Task;
            updateVm.IsCompleted = itemToUpdate.IsCompleted;
            return(View(updateVm));
        }