public ActionResult UpdateAlbum(int? id)
 {
     _facade = new DataAccessLayerfacade();
     _model = new AlbumViewModels();
     _model.GetSelectedAlbum = _facade.GetAlbumRep().GetAlbumById(id);
     return View(_model);
 }
 public ActionResult CreateAlbum()
 {
     _facade = new DataAccessLayerfacade();
     var model = new AlbumViewModels();
     model.AllArtists = _facade.GetArtistRep().GetAllArtist();
     model.AllGenres = _facade.GetGenreRep().GetAllGenres();
     return View(model);
 }
 public ActionResult Index(int? id)
 {
     _facade = new DataAccessLayerfacade();
     _model = new AlbumViewModels();
  
     if (_facade.GetAlbumRep().GetAllAlbums().Count == 0)
     {
         _model.AllAlbums = _facade.GetAlbumRep().GetAllAlbums();
     }
     else
     {
         _model.AllAlbums = _facade.GetAlbumRep().GetAllAlbums();
         _model.GetSelectedAlbum = id != null ? _model.AllAlbums.FirstOrDefault(a => a.id == id) : _model.AllAlbums.FirstOrDefault();
     }
     return View(_model);
 }