📜  JsonConvert.DeserializeObject 选项camelcasing c# .net - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:39.940000             🧑  作者: Mango

代码示例2
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);