Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

JsonConvert.DeserializeObject options camelcasing c# .net

Dictionary<string, object> jo = new Dictionary<string, object>();
jo.Add("CamelCase", 1);

var settings = new JsonSerializerSettings()
{
    ContractResolver = new CamelCasePropertyNamesContractResolver()
};

var serialized = JsonConvert.SerializeObject(jo, settings);

Assert.AreEqual("{"camelCase":1}", serialized);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #options #camelcasing
ADD COMMENT
Topic
Name
9+6 =