public IActionResult ConfirmDelete(int id)
 {
     // var musicToDelete = _mediaService.GetAllMedia().OfType<Music>().First(x => x.Id == id);
     _mediaService.DeleteMediaById(id);
     _mediaService.SaveChanges();
     return(RedirectToAction("Index"));
 }
 public IActionResult ConfirmDelete(int Id)
 {
     _mediaService.GetAllRatings().Where(rat => rat.Media.Id == Id);
     _mediaService.SaveChanges();
     _mediaService.DeleteMediaById(Id);
     _mediaService.SaveChanges();
     return(RedirectToAction("Index"));
 }