Saturday, February 28, 2015

Deserialize to object

Hi Sigurd,


According to this page, http://ift.tt/1LZlQL6, you need to read the json file to MemoryStream object, then use ReadObject method to parse to the available class. Code snippet may look like the following.



MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(jsonString));

DataContractJsonSerializer ser = new DataContractJsonSerializer((typeof(WordsItem));

item = ser.ReadObject(ms) as WordsItem;

Try and let me know the result.


Regards,




We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

Click HERE to participate the survey.


No comments:

Post a Comment