public IActionResult DeleteTaskById(ToDoItem toDoItem) { _toDoListRepository.DeleteTask(toDoItem); if (!_toDoListRepository.SaveTask()) { return(StatusCode(500, "An error occurred while trying to delete your task.")); } return(NoContent()); }