How do DataContracts work? - Deserialize Json

后端 未结 1 1546
天涯浪人
天涯浪人 2021-01-27 05:21

I grabbed an example off of this SO question, and built my own custom Google Maps object used for deserializing the json object.

Now the code works like a champ, but I j

相关标签:
1条回答
  • 2021-01-27 06:20

    Internally, DataContractJsonSerializer maps JSON name/value pairs to an XML infoset. In fact, DataContractJsonSerializer is built on top of the XML-based DataContractSerializer and processes every JSON input and JSON output as if it were dealing with XML. There is a higher-level abstraction layer (a JSON writer and a JSON reader, as exposed via JsonReaderWriterFactory) that actually translates this XML to JSON and JSON back to internal XML.

    See this excellent overview (Mapping Between JSON and XML) to see what happens to DataContractJsonSerializer internally and how it pulls all this off.

    0 讨论(0)
提交回复
热议问题