Beispiel #1
0
 public IActionResult Delete(long id)
 {
     try
     {
         Note note = _notesBL.Get(id);
         if (note == null)
         {
             return(NotFound("The User record couldn't be found."));
         }
         if (note.IsTrash == true)
         {
             _notesBL.Delete(note);
             return(this.Ok(new { success = true, message = "Successfully deleted" }));
         }
         else
         {
             return(BadRequest("Note is not in trash"));
         }
     }
     catch (Exception ex)
     {
         return(this.BadRequest(new { success = false, message = ex.Message }));
     }
 }