src/Orleans.Serialization/Hosting/SerializerBuilderExtensions.cs
/// <summary>
/// Adds an assembly to the builder.
/// </summary>
/// <param name="builder">The builder.</param>
/// <param name="assembly">The assembly.</param>
/// <returns>The serialization builder</returns>
Adds an assembly to the builder.
Adds an assembly to the builder .
public static ISerializerBuilder AddAssembly(this ISerializerBuilder builder, Assembly assembly)
        {
            var builderImpl = (ISerializerBuilderImplementation)builder;
            var properties = builderImpl.Properties;
            HashSet<Assembly> assembliesSet;
            if (!properties.TryGetValue(_assembliesKey, out var assembliesSetObj))
            {
                assembliesSet = new HashSet<Assembly>();
                properties[_assembliesKey] = assembliesSet;
            }
            else
            {
                assembliesSet = (HashSet<Assembly>)assembliesSetObj;
            }
            if (!assembliesSet.Add(assembly))
            {
                return builder;
            }
            var attrs = assembly.GetCustomAttributes<TypeManifestProviderAttribute>();
            foreach (var attr in attrs)
            {
                _ = builderImpl.ConfigureServices(services => services.AddSingleton(typeof(IConfigureOptions<TypeManifestOptions>), attr.ProviderType));
            }
            return builder;
        }
public static ISerializerBuilder AddAssembly ( this ISerializerBuilder builder , Assembly assembly ) { var builderImpl = ( ISerializerBuilderImplementation ) builder ; var properties = builderImpl . Properties ; HashSet < Assembly > assembliesSet ; if ( ! properties . TryGetValue ( _assembliesKey , out var assembliesSetObj ) ) { assembliesSet = new HashSet < Assembly > ( ) ; properties [ _assembliesKey ] = assembliesSet ; } else { assembliesSet = ( HashSet < Assembly > ) assembliesSetObj ; } if ( ! assembliesSet . Add ( assembly ) ) { return builder ; } var attrs = assembly . GetCustomAttributes < TypeManifestProviderAttribute > ( ) ; foreach ( var attr in attrs ) { _ = builderImpl . ConfigureServices ( services => services . AddSingleton ( typeof ( IConfigureOptions < TypeManifestOptions > ) , attr . ProviderType ) ) ; } return builder ; }
Adds an assembly to the builder.
Adds an assembly to the builder .
The serialization builder
The serialization builder
ISerializerBuilder
this
assembly
Assembly
None
builder
None