C# JsonSettings/JsonSerializerSettings参数设置类
C# JsonSettings/JsonSerializerSettings参数设置类
C# Code:
/// <summary>
/// JSON转换参数设置
/// </summary>
public static JsonSerializerSettings Settings
{
get
{
Newtonsoft.Json.JsonSerializerSettings settings = new Newtonsoft.Json.JsonSerializerSettings();
settings.NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore;//忽略Null值处理
settings.DateFormatString = "yyyy-MM-dd HH:mm:ss";//日期格式
settings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;//忽略对象循环引用
return settings;
}
}
//来源:C/S框架网 | www.csframework.com | QQ:23404761
/// JSON转换参数设置
/// </summary>
public static JsonSerializerSettings Settings
{
get
{
Newtonsoft.Json.JsonSerializerSettings settings = new Newtonsoft.Json.JsonSerializerSettings();
settings.NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore;//忽略Null值处理
settings.DateFormatString = "yyyy-MM-dd HH:mm:ss";//日期格式
settings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;//忽略对象循环引用
return settings;
}
}
//来源:C/S框架网 | www.csframework.com | QQ:23404761
版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
NewDoc C/S框架网