src/Orleans.Core/Configuration/NamedServiceConfigurator.cs
/// <summary>
/// Adds a singleton component to a named service.
/// </summary>
/// <typeparam name="TComponent">The component service type.</typeparam>
/// <param name="configurator">The named configurator which the component will be configured for.</param>
/// <param name="factory">The factory used to create the component for the named service.</param>
Adds a singleton component to a named service.
Adds a singleton component to a named service .
public static void ConfigureComponent<TComponent>(this INamedServiceConfigurator configurator, Func<IServiceProvider, string, TComponent> factory)
           where TComponent : class
        {
            configurator.ConfigureDelegate(services =>
            {
                services.AddSingletonNamedService(configurator.Name, factory);
            });
        }
public static void ConfigureComponent < TComponent > ( this INamedServiceConfigurator configurator , Func < IServiceProvider , string , TComponent > factory ) where TComponent : class { configurator . ConfigureDelegate ( services => { services . AddSingletonNamedService ( configurator . Name , factory ) ; } ) ; }
Adds a singleton component to a named service.
Adds a singleton component to a named service .
INamedServiceConfigurator
this
factory
Func<IServiceProvider, string, TComponent>
The factory used to create the component for the named service.
The factory used to create the component for the named service .
configurator
The named configurator which the component will be configured for.
The named configurator which the component will be configured for .
typeparam
The component service type.
The component service type .