NamedServiceConfiguratorExtensions.ConfigureComponent 方法

定义

重载

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

将单一实例组件添加到命名服务。

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

将单一实例组件添加到命名服务,并为命名服务配置选项。

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

Source:
NamedServiceConfigurator.cs

将单一实例组件添加到命名服务。

public static void ConfigureComponent<TComponent> (this Orleans.Hosting.INamedServiceConfigurator configurator, Func<IServiceProvider,string,TComponent> factory) where TComponent : class;
static member ConfigureComponent : Orleans.Hosting.INamedServiceConfigurator * Func<IServiceProvider, string, 'Component (requires 'Component : null)> -> unit (requires 'Component : null)
<Extension()>
Public Sub ConfigureComponent(Of TComponent As Class) (configurator As INamedServiceConfigurator, factory As Func(Of IServiceProvider, String, TComponent))

类型参数

TComponent

组件服务类型。

参数

configurator
INamedServiceConfigurator

将为其配置组件的命名配置器。

factory
Func<IServiceProvider,String,TComponent>

用于为命名服务创建组件的工厂。

适用于

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

Source:
NamedServiceConfigurator.cs

将单一实例组件添加到命名服务,并为命名服务配置选项。

public static void ConfigureComponent<TOptions,TComponent> (this Orleans.Hosting.INamedServiceConfigurator configurator, Func<IServiceProvider,string,TComponent> factory, Action<Microsoft.Extensions.Options.OptionsBuilder<TOptions>> configureOptions = default) where TOptions : class, new() where TComponent : class;
static member ConfigureComponent : Orleans.Hosting.INamedServiceConfigurator * Func<IServiceProvider, string, 'Component (requires 'Component : null)> * Action<Microsoft.Extensions.Options.OptionsBuilder<'Options>> -> unit (requires 'Options : null and 'Options : (new : unit -> 'Options) and 'Component : null)
<Extension()>
Public Sub ConfigureComponent(Of TOptions As {Class, New}, TComponent As {Class, New}) (configurator As INamedServiceConfigurator, factory As Func(Of IServiceProvider, String, TComponent), Optional configureOptions As Action(Of OptionsBuilder(Of TOptions)) = Nothing)

类型参数

TOptions

正在配置的选项类型。

TComponent

正在注册的组件服务类型。

参数

configurator
INamedServiceConfigurator

将为其配置组件和选项的命名配置器。

factory
Func<IServiceProvider,String,TComponent>

用于为命名服务创建组件的工厂。

configureOptions
Action<OptionsBuilder<TOptions>>

用于配置命名服务选项的委托。

适用于