Ejemplo n.º 1
0
 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}"));
     }
 }
Ejemplo n.º 2
0
 public async Task <bool> Delete(int id)
 {
     return(await _toDoService.DeleteTask(id));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Deletes the specified todo-item.
 /// </summary>
 /// <param name="id">The todo item identifier.</param>
 public void Delete(int id)
 {
     _toDoService.DeleteTask(id);
 }
Ejemplo n.º 4
0
        public async Task <IActionResult> DeleteById(int id)
        {
            await _toDoService.DeleteTask(id);

            return(NoContent());
        }