public IActionResult List(int?bandId, int?borrowerId) { if (bandId == null && borrowerId == null) { //all albums var albums = _albumRepository.GetAllWithBand(); return(CheckAlbums(albums)); } else if (bandId != null) { //filter by bandID var band = _bandRepository.GetWithAlbums((int)bandId); if (band.Albums.Count() == 0) { return(View("BandEmpty", band)); } else { return(View(band.Albums)); } } else if (borrowerId != null) { //filter by borrowerId var albums = _albumRepository.FindWithBandAndBorrower(album => album.BorrowerId == borrowerId); return(CheckAlbums(albums)); } else { throw new ArgumentException(); } }