This sample creates a custom Argon.IContractResolver
that only serializes a type's properties that begin with a specified character.
var person = new Person
{
FirstName = "Dennis",
LastName = "Deepwater-Diver"
};
var startingWithF = JsonConvert.SerializeObject(person, Formatting.Indented,
new JsonSerializerSettings {ContractResolver = new DynamicContractResolver('F')});
Console.WriteLine(startingWithF);
// {
// "FirstName": "Dennis",
// "FullName": "Dennis Deepwater-Diver"
// }
var startingWithL = JsonConvert.SerializeObject(person, Formatting.Indented,
new JsonSerializerSettings {ContractResolver = new DynamicContractResolver('L')});
Console.WriteLine(startingWithL);
// {
// "LastName": "Deepwater-Diver"
// }