• 周一. 10 月 7th, 2024

5G编程聚合网

5G时代下一个聚合的编程学习网

热门标签

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

admin

11 月 28, 2021
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);

发表回复