Newtonsoft.Json 序列化小写首字母

//json对象命名小驼峰式转换
var json = JsonConvert.SerializeObject(newAccount, Formatting.Indented, new JsonSerializerSettings
{
ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver()
});

Account newAccount2 = JsonConvert.DeserializeObject<Account>(json, new JsonSerializerSettings
{
ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver()
});

上一篇:Springboot 系列(六)Spring Boot web 开发之拦截器和三大组件


下一篇:[C++项目]2048控制台游戏