C# Newtonsoft.Json JsonSerializerSettings 全局序列化设置
2021-07-11 08:06
阅读:407
});
序列化时 指定Key的处理方式,为驼峰式
CamelCasePropertyNamesContractResolver
//设置序列化时key为驼峰样式
JsonSerializerSettings settings = new JsonSerializerSettings();
settings.ContractResolver = new CamelCasePropertyNamesContractResolver();
settings.Formatting = Formatting.Indented;
string str = JsonConvert.SerializeObject(menus, settings);
文章来自:搜素材网的编程语言模块,转载请注明文章出处。
文章标题:C# Newtonsoft.Json JsonSerializerSettings 全局序列化设置
文章链接:http://soscw.com/index.php/essay/103610.html
文章标题:C# Newtonsoft.Json JsonSerializerSettings 全局序列化设置
文章链接:http://soscw.com/index.php/essay/103610.html
评论
亲,登录后才可以留言!