C# JsonSettings/JsonSerializerSettings参数设置类
作者:C/S框架网|www.cscode.ne  发布日期:2021-03-18 12:19:52
  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




上一篇 下一篇