HostBuilder.ConfigureContainer<TContainerBuilder> 方法

定义

允许配置实例化的依赖项容器。 可多次进行调用,并累加结果。

public:
generic <typename TContainerBuilder>
 virtual Microsoft::Extensions::Hosting::IHostBuilder ^ ConfigureContainer(Action<Microsoft::Extensions::Hosting::HostBuilderContext ^, TContainerBuilder> ^ configureDelegate);
public Microsoft.Extensions.Hosting.IHostBuilder ConfigureContainer<TContainerBuilder> (Action<Microsoft.Extensions.Hosting.HostBuilderContext,TContainerBuilder> configureDelegate);
abstract member ConfigureContainer : Action<Microsoft.Extensions.Hosting.HostBuilderContext, 'ContainerBuilder> -> Microsoft.Extensions.Hosting.IHostBuilder
override this.ConfigureContainer : Action<Microsoft.Extensions.Hosting.HostBuilderContext, 'ContainerBuilder> -> Microsoft.Extensions.Hosting.IHostBuilder
Public Function ConfigureContainer(Of TContainerBuilder) (configureDelegate As Action(Of HostBuilderContext, TContainerBuilder)) As IHostBuilder

类型参数

TContainerBuilder

要创建的生成器的类型。

参数

configureDelegate
Action<HostBuilderContext,TContainerBuilder>

配置将用于构造主机的 IConfigurationIConfigurationBuilder 的委托。

返回

用于链接的相同 IHostBuilder 实例。

实现

适用于