Beispiel #1
0
        public IActionResult Delete(int id)
        {
            var data = _todoListService.Delete(id);

            if (data > 0)
            {
                return(Ok(data));
            }
            return(BadRequest("Bad Request"));
        }
Beispiel #2
0
 /// <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));
     }
 }
Beispiel #3
0
        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));
        }
Beispiel #5
0
 public void Delete(string id)
 {
     todoListService.Delete(Guid.Parse(id));
 }
Beispiel #6
0
 public void Delete(int id) => _todoListService.Delete(_todoListService.Get(id));
 public string Delete(int id)
 {
     // to delete item.
     return(_todoListService.Delete(id));
 }