public IActionResult DeleteFromTrash(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.DeleteFromTrash(note); return(this.Ok(new { success = true, message = "Note deleted successfully" })); } else { return(BadRequest("Note is not in trash")); } } catch (Exception ex) { return(this.BadRequest(new { success = false, message = ex.Message })); } }