Windows应用商店应用:解析大量的JSON(Windows Store Apps: parsing large chunks of JSON)

我有一个连接到REST API的应用程序,以检索JSON格式的一些数据。

有时响应是大字符串的形式。

什么是解析如此大量数据的最有效方法。 我检查了DataContractJsonSerializer,但解析不是异步的。

是否有另一个库或技术来异步解析大块?

I have an application that connects to a REST API to retrieve some data in JSON format.

sometimes the response is in the form of large string.

what is the most efficient way to parse such a large chunk of data. I checked DataContractJsonSerializer but the parsing is not asynchronous.

is there another library or technique to parse large chunks asynchronously ?

最满意答案

使用JSON.NET。

http://james.newtonking.com/projects/json/help/index.html?topic=html/M_Newtonsoft_Json_JsonConvert_DeserializeObjectAsync_1.htm

您可以像以下一样使用它:

var data = await JsonConvert.DeserializeObjectAsync<ROOT_OBJECT>(stringData);

Use JSON.NET.

http://james.newtonking.com/projects/json/help/index.html?topic=html/M_Newtonsoft_Json_JsonConvert_DeserializeObjectAsync_1.htm

You can use it like:

var data = await JsonConvert.DeserializeObjectAsync<ROOT_OBJECT>(stringData);

更多推荐