Click or drag to resize
Json.NETContractResolver setting
 

This sample uses a custom IContractResolver to modify how objects are serialized.

Sample
Types
 1public class Person
 2{
 3    public string FirstName { get; set; }
 4    public string LastName { get; set; }
 5
 6    public string FullName
 7    {
 8        get { return FirstName + " " + LastName; }
 9    }
10}
Usage
 1Person person = new Person
 2{
 3    FirstName = "Sarah",
 4    LastName = "Security"
 5};
 6
 7string json = JsonConvert.SerializeObject(person, Formatting.Indented, new JsonSerializerSettings
 8{
 9    ContractResolver = new CamelCasePropertyNamesContractResolver()
10});
11
12Console.WriteLine(json);
13// {
14//   "firstName": "Sarah",
15//   "lastName": "Security",
16//   "fullName": "Sarah Security"
17// }