Entitiy representing an album.
コード例 #1
0
ファイル: DeezerClient.cs プロジェクト: PlumpMath/vlcwinrt
        public async Task <List <Album> > GetArtistTopAlbums(string artistId)
        {
            var    deezerClient = new HttpClient();
            string json         = await deezerClient.GetStringAsync(string.Format("http://api.deezer.com/artist/{0}/albums", artistId));

            var deezerAlbums = JsonConvert.DeserializeObject <Albums>(json);

            if (deezerAlbums == null)
            {
                return(null);
            }
            if (deezerAlbums.Data == null)
            {
                return(null);
            }
            var albumList = new List <Album>();

            foreach (var deezerAlbum in deezerAlbums.Data)
            {
                var album = new Album();
                album.MapFrom(deezerAlbum);
                albumList.Add(album);
            }
            return(albumList);
        }
コード例 #2
0
ファイル: DeezerClient.cs プロジェクト: kusl/vlcwinrt
 public async Task<List<Album>> GetArtistTopAlbums(string artistId)
 {
     var deezerClient = new HttpClient();
     string json = await deezerClient.GetStringAsync(string.Format("http://api.deezer.com/artist/{0}/albums", artistId));
     var deezerAlbums = JsonConvert.DeserializeObject<Albums>(json);
     if (deezerAlbums == null) return null;
     if (deezerAlbums.Data == null) return null;
     var albumList = new List<Album>();
     foreach (var deezerAlbum in deezerAlbums.Data)
     {
         var album = new Album();
         album.MapFrom(deezerAlbum);
         albumList.Add(album);
     }
     return albumList;
 }