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

时间:2014-05-29 16:38:13   收藏:0   阅读:368
bubuko.com,布布扣
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);
bubuko.com,布布扣

 

Web Api 返回参数,实现统一标准化!,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!