Web Api 返回参数,实现统一标准化!

string camelCaseObj = JsonConvert.SerializeObject(data,
                                     Newtonsoft.Json.Formatting.None,
                                     new JsonSerializerSettings()
                                     {
                                         NullValueHandling = NullValueHandling.Ignore,
                                         ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
                                         ContractResolver = new CamelCasePropertyNamesContractResolver()
                                     }); //--驼峰格式的命名规范
camelCaseObj= camelCaseObj.ToLower();    //--全部小写的命名规范
var jsonConvertCommonData = JsonConvert.DeserializeObject(camelCaseObj);

 

转载于:https://www.cnblogs.com/Kummy/p/3758469.html

上一篇:git eclipse 取消误操作 ignore(忽略)文件


下一篇:mysql数据库主从同步部分库或表syncnavigator