http://jackyrong.iteye.com/blog/2005323 ********************************************** 对于一直用gson的人来说,如果单独用jackson,真是麻烦了,但还是得小结下了: 先来看下如何自定义把某个对象序列化为json: 先是对象: Java代码 public class User { public int id; public String name; } public class Item { public…
public class JsonUtil { public static T DeserializeObject<T>(string json) { DataContractJsonSerializer jsonFormator = new DataContractJsonSerializer(typeof(T)); using (Stream readStream = new MemoryStream(Encod…