// GET: SongModels public ActionResult Index() { var song = db.Song.Include(s => s.Album).Include(s => s.Style).ToList(); SongBinder songBinder = new SongBinder(); ICollection <SongModel> songModel = songBinder.Bind(song); return(View(songModel)); }
// GET: SongModels public ActionResult GetSongsBySingerId(int singerId) { var song = db.Song.Where(s => s.Album.SingerId == singerId).ToList(); ICollection <SongModel> songModel = new List <SongModel>(); SongBinder songBinder = new SongBinder(); songModel = songBinder.Bind(song); return(View("Index", songModel)); }