📅  最后修改于: 2022-03-11 14:48:39.940000             🧑  作者: Mango
Dictionary jo = new Dictionary();
jo.Add("CamelCase", 1);
var settings = new JsonSerializerSettings()
{
ContractResolver = new CamelCasePropertyNamesContractResolver()
};
var serialized = JsonConvert.SerializeObject(jo, settings);
Assert.AreEqual("{\"camelCase\":1}", serialized);