public ActionResult DeleteTask(int userId, [FromQuery] int taskId) { try { _toDoService.DeleteTask(userId, taskId); return(Ok("Successfully deleted task!")); } catch (ToDoException ex) { return(BadRequest($"ToDo Exception:{ex.Message}")); } catch (Exception ex) { return(BadRequest($"Something went wrong:{ex.Message}")); } }
public async Task <bool> Delete(int id) { return(await _toDoService.DeleteTask(id)); }
/// <summary> /// Deletes the specified todo-item. /// </summary> /// <param name="id">The todo item identifier.</param> public void Delete(int id) { _toDoService.DeleteTask(id); }
public async Task <IActionResult> DeleteById(int id) { await _toDoService.DeleteTask(id); return(NoContent()); }