Table of Contents

Class JsonSerializationFns

Namespace
Breeze.Core
Assembly
Breeze.Core.dll

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

ss JsonSerializerSettings

Initial settings, see example below.

camelCasing bool

Whether to camelCase property names. Default is false because this is normally handled on the client.

useIntEnums bool

Whether 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();
}