public IActionResult Delete(int id) { var task = _toDoTaskServices.GetTask(id); if (task == null) { return(BadRequest()); } _toDoTaskServices.Delete(id); return(Ok()); }
// DELETE: api/ToDoTasks/DeleteToDoTask/{id} public IHttpActionResult DeleteToDoTask(int id) { try { var toDoTaskDTO = _toDoTaskService.Delete(id); return(Ok(toDoTaskDTO)); } catch (DeleteEntityException) { return(NotFound()); } }