JSON对象反序列化错误

时间:2017-06-15 17:16:09

标签: json vb.net deserialization

我收到的错误声明要实现一个集合,但我不明白为什么我的对象应该是一个要反序列化的集合。我有下面的代码和对象。第一行是我对象的实现。第二段是正在实施的类。最后一段是实际的JSON对象本身。我不相信较低级别的对象是必要的,但如果有人要求我会添加它们。

Dim lgInformation As LeagueInformation = JsonConvert.DeserializeObject(Of LeagueInformation)(rrm.returnLeagueSummoner(lgSummoner.id.ToString(), strRegion))


Public Class LeagueInformation
    Public Property name As String
    Public Property tier As String
    Public Property queue As String
    Public Property entries As New List(Of LeagueItemDTO)
    Public Sub New()
    End Sub
End Class
[{
    "name": "Viktor's Crushers",
    "tier": "BRONZE",
    "queue": "RANKED_SOLO_5x5",
    "entries": [{
        "playerOrTeamId": "39975217",
        "playerOrTeamName": "Buick McCain",
        "leaguePoints": 79,
        "rank": "V",
        "wins": 32,
        "losses": 33,
        "veteran": false,
        "inactive": false,
        "freshBlood": false,
        "hotStreak": false
    }, {
        "playerOrTeamId": "66583855",
        "playerOrTeamName": "timetogetrektm8",
        "leaguePoints": 38,
        "rank": "II",
        "wins": 57,
        "losses": 57,
        "veteran": true,
        "inactive": false,
        "freshBlood": false,
        "hotStreak": false
    }, {
        "playerOrTeamId": "68452158",
        "playerOrTeamName": "AllistairGrey",
        "leaguePoints": 40,
        "rank": "I",
        "wins": 9,
        "losses": 4,
        "veteran": false,
        "inactive": false,
        "freshBlood": false,
        "hotStreak": false
    }]
}]

0 个答案:

没有答案