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()
});

原文地址:https://www.cnblogs.com/icebutterfly/p/9305806.html