I would like to create a document using the DocumentDb API using custom JsonSerializerSettings. Can anyone tell me how I can do this?
I have tried setting
JsonConvert.DefaultSettings = () => {
return new JsonSerializerSettings() {
ContractResolver = new CamelCasePropertyNameContractResolver()
};
};
The latest DocumentDB SDK (1.15.0) exposes now the JsonSerializerSettings.
You can define your custom settings when you create the DocumentClient
instance:
DocumentClient yourClient = new DocumentClient(new Uri("Your Service Endpoint"), "Your Account Key", serializerSettings: new JsonSerializerSettings()
{
// Custom settings
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With