CSharp examples for System.Runtime.Serialization.Json:Json
Deserializes an object from JSON
using System.Text; using System.Security.Cryptography; using System.Net.Http.Formatting; using System.IO;//from w ww . j a v a 2s. c om using System; public class Main{ /// <summary> /// Deserializes an object from JSON /// </summary> /// <typeparam name="T"></typeparam> /// <param name="str"></param> /// <returns></returns> public static T DeserializeFromJson<T>(string str) where T : class { var json = new JsonMediaTypeFormatter(); return StringHelper.Deserialize<T>(json, str); } }