{"232341":{"id":232341,"name":"HCaKpdWjUG5Coh32","profileIconId":-1,"summonerLevel":1,"revisionDate":1320361798000},
"232340":{"id":232340,"name":"f6Q3RQEgQSwO3SRT","profileIconId":-1,"summonerLevel":1,"revisionDate":1323137663000},
"232362":{"id":232362,"name":"To1UB04fHW74LFRT","profileIconId":-1,"summonerLevel":1,"revisionDate":1323137663000}
所以这是我收到的json输出,我想只以我选择的格式写出数据。但是当我尝试反序列化时,我遇到了麻烦。我目前有2节课。
public class DataContainer
{
public List<Summoner> summoners { get; set; }
}
public class Summoner
{
public int id { get; set; }
public string name { get; set; }
public int profileIconId { get; set; }
public int summonerLevel { get; set; }
public long revisionDate { get; set; }
}
我在这行代码的帮助下反序化它:
var observation = JsonConvert.DeserializeObject<LDataContainer>(json);
但是现在当我调试它时,变量观察为空。它不会添加任何summoners。我已经尝试了所有我能做的事情,但是在C#中进行反序列化实际上让我很困惑。