Web Api 返回参数,实现统一标准化!
2020-12-13 02:07
标签:des c style class blog code Web Api 返回参数,实现统一标准化!,搜素材,soscw.com Web Api 返回参数,实现统一标准化! 标签:des c style class blog code 原文地址:http://www.cnblogs.com/Kummy/p/3758469.htmlstring 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);