Beispiel #1
0
        public ActionResult AbumsByGenre(int id_genre)
        {
            Genres styles    = new Genres();
            var    genres    = styles.GetGenresByIdFromAPI(id_genre);
            var    genreList = from genre in genres
                               where genre.Id_genre == id_genre
                               select genre;

            foreach (var item in genreList)
            {
                ViewBag.Title = item.Name_genre;
            }

            var artists = ar.GetArtistsFromAPI();

            ViewBag.Dico = new Dictionary <string, string>();
            var query = from artist in artists
                        select new
            {
                artist.Id_artist,
                artist.Name_artist
            };

            foreach (var item in query)
            {
                ViewBag.Dico.Add(item.Id_artist, item.Name_artist);
            }

            List <Album> liste = new List <Album>();

            liste = al.GetAlbumsbyGenreFromAPI(id_genre);
            return(View(liste));
        }