Exemple #1
0
 public async Task <ActionResult <IEnumerable <Song> > > Delete(int id)
 {
     try
     {
         Song song = _songService.GetSong(id);
         await _adminService.Delete(song);
     }
     catch (Exception ex)
     {
         _logger.LogError(ex, "exeption while deleting song");
         return(Problem("exeption while getting song"));
     }
     return(InnerGet());
 }
Exemple #2
0
 public async Task <ActionResult <IEnumerable <Note> > > Delete(int id)
 {
     try
     {
         Note note = _noteService.GetNotes().FirstOrDefault(note => note.NoteId == id);
         await _adminService.Delete(note);
     }
     catch (Exception ex)
     {
         _logger.LogError(ex, "exeption while deleting notes");
         return(Problem("exeption while getting notes"));
     }
     return(InnerGet());
 }
 public async Task <ActionResult <IEnumerable <Comment> > > Delete(int id)
 {
     try
     {
         Comment comment = _commentService.GetComments().FirstOrDefault(comment => comment.CommentId == id);
         await _adminService.Delete(comment);
     }
     catch (Exception ex)
     {
         _logger.LogError(ex, "exeption while deleting song");
         return(Problem("exeption while getting song"));
     }
     return(InnerGet());
 }
 public async Task <ActionResult <IEnumerable <Spotlight> > > Delete(int id)
 {
     try
     {
         Spotlight spotlight = _spotlightService.GetSpotlights().FirstOrDefault(spotlight => spotlight.SpotlightId == id);
         await _adminService.Delete(spotlight);
     }
     catch (Exception ex)
     {
         _logger.LogError(ex, "exeption while deleting spotlight");
         return(Problem("exeption while getting spotlight"));
     }
     return(InnerGet());
 }