1.创建自定义合同解析器。
public class LowercaseContractResolver : DefaultContractResolver
{
protected override string ResolvePropertyName(string propertyName)
{
return propertyName.ToLower();
}
}
2.调用
var settings = new JsonSerializerSettings();
settings.ContractResolver = new LowercaseContractResolver();
var json = JsonConvert.SerializeObject(this, Formatting.Indented, settings);
原文:https://www.cnblogs.com/kittyajoke/p/14684707.html