src/Orleans.Core/Serialization/OrleansJsonSerializer.cs
/// <summary>
/// Returns the default serializer settings.
/// </summary>
/// <returns>The default serializer settings.</returns>
Returns the default serializer settings.
Returns the default serializer settings .
public static JsonSerializerSettings GetDefaultSerializerSettings(IServiceProvider services)
        {
            var typeResolver = services.GetRequiredService<TypeResolver>();
            var serializationBinder = new OrleansJsonSerializationBinder(typeResolver);
            var settings = new JsonSerializerSettings
            {
                TypeNameHandling = TypeNameHandling.All,
                PreserveReferencesHandling = PreserveReferencesHandling.Objects,
                DateFormatHandling = DateFormatHandling.IsoDateFormat,
                DefaultValueHandling = DefaultValueHandling.Ignore,
                MissingMemberHandling = MissingMemberHandling.Ignore,
                NullValueHandling = NullValueHandling.Ignore,
                ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,
                TypeNameAssemblyFormatHandling = TypeNameAssemblyFormatHandling.Simple,
                Formatting = Formatting.None,
                SerializationBinder = serializationBinder
            };
            settings.Converters.Add(new IPAddressConverter());
            settings.Converters.Add(new IPEndPointConverter());
            settings.Converters.Add(new GrainIdConverter());
            settings.Converters.Add(new SiloAddressConverter());
            settings.Converters.Add(new UniqueKeyConverter());
            settings.Converters.Add(new GrainReferenceJsonConverter(services.GetRequiredService<GrainReferenceActivator>()));
            return settings;
        }
public static JsonSerializerSettings GetDefaultSerializerSettings ( IServiceProvider services ) { var typeResolver = services . GetRequiredService < TypeResolver > ( ) ; var serializationBinder = new OrleansJsonSerializationBinder ( typeResolver ) ; var settings = new JsonSerializerSettings { TypeNameHandling = TypeNameHandling . All , PreserveReferencesHandling = PreserveReferencesHandling . Objects , DateFormatHandling = DateFormatHandling . IsoDateFormat , DefaultValueHandling = DefaultValueHandling . Ignore , MissingMemberHandling = MissingMemberHandling . Ignore , NullValueHandling = NullValueHandling . Ignore , ConstructorHandling = ConstructorHandling . AllowNonPublicDefaultConstructor , TypeNameAssemblyFormatHandling = TypeNameAssemblyFormatHandling . Simple , Formatting = Formatting . None , SerializationBinder = serializationBinder } ; settings . Converters . Add ( new IPAddressConverter ( ) ) ; settings . Converters . Add ( new IPEndPointConverter ( ) ) ; settings . Converters . Add ( new GrainIdConverter ( ) ) ; settings . Converters . Add ( new SiloAddressConverter ( ) ) ; settings . Converters . Add ( new UniqueKeyConverter ( ) ) ; settings . Converters . Add ( new GrainReferenceJsonConverter ( services . GetRequiredService < GrainReferenceActivator > ( ) ) ) ; return settings ; }
Returns the default serializer settings.
Returns the default serializer settings .
The default serializer settings.
The default serializer settings .
services
IServiceProvider