public void UpdateTodo(int id, ToDoUpdate item) { var todo = _toDoRepository.GetById(id); todo.Title = item.Title; todo.DeadLine = Convert.ToDateTime(item.DeadLine); todo.EndDate = Convert.ToDateTime(item.EndDate); _toDoRepository.Update(todo); }
public IActionResult Update([FromRoute] int id, [FromBody] ToDoUpdate todo) { _toDoService.UpdateTodo(id, todo); return(Ok()); }