4
For when the return is only 1 record I use the following:
{
"id": "27",
"name": "Daft Punk",
"link": "https://www.deezer.com/artist/27",
"share": "http://www.deezer.com/artist/27?utm_source=deezer&utm_content=artist-27&utm_term=767484347_1452533115&utm_medium=web",
"picture": "https://api.deezer.com/artist/27/image",
"picture_small": "https://cdns-images.dzcdn.net/images/artist/f2bc007e9133c946ac3c3907ddc5d2ea/56x56-000000-80-0-0.jpg",
"picture_medium": "https://cdns-images.dzcdn.net/images/artist/f2bc007e9133c946ac3c3907ddc5d2ea/250x250-000000-80-0-0.jpg",
"picture_big": "https://cdns-images.dzcdn.net/images/artist/f2bc007e9133c946ac3c3907ddc5d2ea/500x500-000000-80-0-0.jpg",
"nb_album": 27,
"nb_fan": 2958193,
"radio": true,
"tracklist": "https://api.deezer.com/artist/27/top?limit=50",
"type": "artist"
}
C#
public async Task<Artist> GetArtist(int artistId)
{
string responseContent = await this.ExecuteHttpGet(string.Format("/artist/{0}", artistId));
Artist artist = JsonConvert.DeserializeObject<Artist>(responseContent);
artist.CurrentRuntime = this;
return artist;
}
Now I have the following Json:
{
"data": [
{
"id": "13",
"name": "Eminem",
"link": "https://www.deezer.com/artist/13",
"picture": "https://api.deezer.com/artist/13/image",
"picture_small": "https://cdns-images.dzcdn.net/images/artist/9118d4ff7f4ef182684a75cd6a200430/56x56-000000-80-0-0.jpg",
"picture_medium": "https://cdns-images.dzcdn.net/images/artist/9118d4ff7f4ef182684a75cd6a200430/250x250-000000-80-0-0.jpg",
"picture_big": "https://cdns-images.dzcdn.net/images/artist/9118d4ff7f4ef182684a75cd6a200430/500x500-000000-80-0-0.jpg",
"nb_album": 33,
"nb_fan": 7391090,
"radio": true,
"tracklist": "https://api.deezer.com/artist/13/top?limit=50",
"type": "artist"
},
{
"id": "1353250",
"name": "Eminem ft. - Dr. Dre Tribute Band",
"link": "https://www.deezer.com/artist/1353250",
"picture": "https://api.deezer.com/artist/1353250/image",
"picture_small": "https://cdns-images.dzcdn.net/images/artist//56x56-000000-80-0-0.jpg",
"picture_medium": "https://cdns-images.dzcdn.net/images/artist//250x250-000000-80-0-0.jpg",
"picture_big": "https://cdns-images.dzcdn.net/images/artist//500x500-000000-80-0-0.jpg",
"nb_album": 1,
"nb_fan": 490,
"radio": true,
"tracklist": "https://api.deezer.com/artist/1353250/top?limit=50",
"type": "artist"
},
],
"total": 52,
"next": "https://api.deezer.com/search/artist?q=eminem&index=25"
}
How would you get all this back?