Class JsonSerializationFns
Static functions related to JSON serialization
public static class JsonSerializationFns
- Inheritance
-
JsonSerializationFns
- Inherited Members
Methods
UpdateWithDefaults(JsonSerializerSettings, bool, bool)
Set the NewtonSoftJson settings for Breeze serialization of entities. This ensures that the Breeze client can correctly identify and parse entities from the server.
public static JsonSerializerSettings UpdateWithDefaults(JsonSerializerSettings ss, bool camelCasing = false, bool useIntEnums = false)
Parameters
ssJsonSerializerSettingsInitial settings, see example below.
camelCasingboolWhether to camelCase property names. Default is false because this is normally handled on the client.
useIntEnumsboolWhether to pass enum values as int instead of string. Default is false (string) for backward compatibility. See https://github.com/Breeze/breeze.server.net/issues/196
Returns
- JsonSerializerSettings
Examples
services.AddControllers().AddNewtonsoftJson(opt => {
var ss = JsonSerializationFns.UpdateWithDefaults(opt.SerializerSettings, false, BreezeConfig.Instance.UseIntEnums);
ss.SerializationBinder = new NoAnonSerializationBinder();
}