// GET: Albums public ActionResult AllAlbums() { var albums = al.GetAlbumsFromAPI(); 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); } return(View(albums)); }
public ActionResult AbumsByArtist(string id_artist) { Artists ar = new Artists(); var artists = ar.GetArtistsFromAPI(); var artistList = from artist in artists where artist.Id_artist == id_artist select artist; foreach (var item in artistList) { ViewBag.Title = item.Name_artist; } var albums = al.GetAlbumsbyIdFromAPI(id_artist); return(View(albums)); }
// GET: Artists public ActionResult Index() { var artists = ar.GetArtistsFromAPI(); return(View(artists)); }