Deserializing JSON array into strongly typed .NET object

前端 未结 8 768
一个人的身影
一个人的身影 2020-11-30 07:35

When I can call the 3rd party api and get back a single class worth of data everything deserialises fine using this code

TheUser me = jsonSerializer.Deseria         


        
8条回答
  •  孤街浪徒
    2020-11-30 07:48

    Pat, the json structure looks very familiar to a problem i described here - The answer for me was to treat the json representation as a Dictionary, even though there was only 1 entry.

    If I am correct your key is of type string and the value of a List where T represents the class 'TheUser'

    HTH

    PS - if you want better serialisation perf check out using Silverlight Serializer, you'll need to build a WP7 version, Shameless plug - I wrote a blog post about this

提交回复
热议问题