Exemple #1
0
 public IActionResult Delete(Guid id)
 {
     try
     {
         bool isDeleted = _toDoTaskService.DeleteToDoTask(id).Result;
         return(Ok(isDeleted));
     }
     catch (Exception ex)
     {
         //TODO log Exception
         return(BadRequest(ex.Message));
     }
 }
Exemple #2
0
        public async Task <ActionResult <ToDoTaskResponse> > DeleteToDoTask(int id)
        {
            try
            {
                var result = await _toDoTaskService.DeleteToDoTask(HttpContext.User, id);

                if (result == null)
                {
                    return(NotFound(string.Format(Constants.TaskNotFound, id)));
                }

                return(Ok(result));
            }
            catch (Exception)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError,
                                  Constants.ErrorDeleteDatabase));
            }
        }