northwind-demo
northwind-demo copied to clipboard
remove json camelCasing with .net core 3.0
Returning camelCasing JSON is now the default in net core 3.0. However, as shown in the sample app, the formatter is modified to return pascal casing as the casing is changed on the client side.
The thing is that everything still work fine if I remove that code
.AddNewtonsoftJson(opt => {
// Set Breeze defaults for entity serialization
var ss = JsonSerializationFns.UpdateWithDefaults(opt.SerializerSettings);
if (ss.ContractResolver is DefaultContractResolver resolver)
{
resolver.NamingStrategy = null; // remove json camelCasing; names are converted on the client.
}
ss.Formatting = Newtonsoft.Json.Formatting.Indented; // format JSON for debugging
});
So is it needed ?
I'd like to return camelCase Json because I'm mixing up breeze and non-breeze controllers.
That should be fine, as long as your client uses the same NamingConvention.