Skip to content

NamedServiceConfiguratorExtensions Methods

Extensions for working with INamedServiceConfigurator.

Configure(INamedServiceConfigurator, Action<OptionsBuilder<TOptions>>)

staticextension
View source
public static void Configure<TOptions>(this INamedServiceConfigurator configurator, Action<OptionsBuilder<TOptions>> configureOptions)
Configures options for a named service.

Parameters

configuratorINamedServiceConfigurator
The named service configurator.
configureOptionsAction<OptionsBuilder<TOptions>>
The options configuration delegate.

ConfigureComponent(INamedServiceConfigurator, Func<IServiceProvider, string, TComponent>)

staticextension
View source
public static void ConfigureComponent<TComponent>(this INamedServiceConfigurator configurator, Func<IServiceProvider, string, TComponent> factory)
Adds a singleton component to a named service.

Parameters

configuratorINamedServiceConfigurator
The named configurator which the component will be configured for.
factoryFunc<IServiceProvider, string, TComponent>
The factory used to create the component for the named service.

ConfigureComponent(INamedServiceConfigurator, Func<IServiceProvider, string, TComponent>, Action<OptionsBuilder<TOptions>>)

staticextension
View source
public static void ConfigureComponent<TOptions, TComponent>(this INamedServiceConfigurator configurator, Func<IServiceProvider, string, TComponent> factory, Action<OptionsBuilder<TOptions>> configureOptions = null)
Adds a singleton component to a named service and configures options for the named service.

Parameters

configuratorINamedServiceConfigurator
The named configurator which the component and options will be configured for.
factoryFunc<IServiceProvider, string, TComponent>
The factory used to create the component for the named service.
configureOptionsAction<OptionsBuilder<TOptions>>
The delegate used to configure options for the named service.