public IActionResult Delete(int id) { var data = _todoListService.Delete(id); if (data > 0) { return(Ok(data)); } return(BadRequest("Bad Request")); }
/// <summary> /// deletes todo-list item /// </summary> /// <param name="id">id of todo-list item to delete</param> /// <returns></returns> public IHttpActionResult Delete(int id) { try { _todoListsService.Delete(id); return(Ok()); } catch (Exception ex) { return(InternalServerError(ex)); } }
public IActionResult Delete(int userId, int todoListId) { var todoList = _todoListService.Get(userId, todoListId); if (todoList == null) { return(NotFound()); } _todoListService.Delete(todoList); return(NoContent()); }
public IActionResult DeleteItem(Guid id) { var result = new ApiResult <int>(); if (_todoListService.Delete(id) == null) { result.Message = "Task not Found"; return(NotFound(result)); } result.Message = "Task Deleted Correctly"; return(Ok(result)); }
public void Delete(string id) { todoListService.Delete(Guid.Parse(id)); }
public void Delete(int id) => _todoListService.Delete(_todoListService.Get(id));
public string Delete(int id) { // to delete item. return(_todoListService.Delete(id)); }