I have a bunch of classes that will be serialized to JSON at some point and for the sake of following both C# conventions on the back-end and JavaScript conventions on the f
Better to use the new CamelCaseNamingStrategy (since 9.0.1):
new JsonSerializerSettings()
{
ContractResolver = new DefaultContractResolver
{
NamingStrategy = new CamelCaseNamingStrategy()
}
};
It does not override custom names set by JsonPropert('Name')
by default. (You can change the behaviour by CamelCaseNamingStrategy(bool, bool)
ctor.) So, does not need to create custom class like @Matt Burland's answer.