JSON Parse C# null парсил через jsonutils
Есть такого типа JSON
{
"info": {
"category": "Billboard",
"chart": "HOT 100",
"date": "2019-05-11",
"source": "Billboard-API"
},
"content": {
"1": {
"rank": "1",
"title": "Old Town Road",
"artist": "Lil Nas X Featuring Billy Ray Cyrus",
"weeks at no.1": "5",
"last week": "1",
"peak position": "1",
"weeks on chart": "9",
"detail": "same"
},
"2": {
"rank": "2",
"title": "ME!",
"artist": "Taylor Swift Featuring Brendon Urie",
"last week": "100",
"peak position": "2",
"weeks on chart": "2",
"detail": "up"
}}}
Паршу его вот таким образом через jsonutils
public class Info
{
public string category { get; set; }
public string chart { get; set; }
public string date { get; set; }
public string source { get; set; }
}
public class _1
{
public string rank { get; set; }
public string title { get; set; }
public string artist { get; set; }
public string weeks at no.1 { get; set; }
public string last week { get; set; }
public string peak position { get; set; }
public string weeks on chart { get; set; }
public string detail { get; set; }
}
public class _2
{
public string rank { get; set; }
public string title { get; set; }
public string artist { get; set; }
public string last week { get; set; }
public string peak position { get; set; }
public string weeks on chart { get; set; }
public string detail { get; set; }
}
public class Content
{
public _1 _1 { get; set; }
public _2 _2 { get; set; }
}
public class MusicData
{
public Info info { get; set; }
public Content content { get; set; }
}
var Data = JsonConvert.DeserializeObject<MusicData>(Response.Content);
Но при обращении к Data.content._1.artist выводит ошибку null
Пытался через список List и объединить в SongData классы _1,_2 , но результат тот же