Shaofh

Shaofh

2012年9月30日

Newtonsoft中的几个妙用

摘要: 记录Newtonsoft在序列成Json时的两个妙用JsonSerializerSettings js = new JsonSerializerSettings();//1、属性为Null时不做序列化输出 js.NullValueHandling = NullValueHandling.Ignore;//2、属性为DateTime时,做指定的格式输出 js.Converters.Add(new IsoDateTimeConverter() { DateTimeFormat ="yyyy-MM-dd HH:mm:ss" });JsonConvert.SerializeObje 阅读全文

posted @ 2012-09-30 09:27 sh37 阅读(345) 评论(0) 推荐(0) 编辑

导航