Поделиться через


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>)

Исходный код:
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>>)

Исходный код:
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>>

Делегат, используемый для настройки параметров именованной службы.

Применяется к