public ActionResult DeleteTodoItem(int id) { var todoItem = _repository.GetTodoItemById(id); if (todoItem != null) { _repository.DeleteTodoItem(todoItem); _repository.SaveChanges(); return(NoContent()); } return(NotFound()); }
public async Task <TodoItem> GetTodoItemById(long id) { return(await _repo.GetTodoItemById(id)); }