//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
时间: 2024-11-04 05:03:32