HostBuilder.ConfigureContainer<TContainerBuilder>(Action<HostBuilderContext,TContainerBuilder>) 方法

定义

允许配置实例化的依赖项容器。Enables configuring the instantiated dependency container. 可多次进行调用,并累加结果。This can be called multiple times and the results will be additive.

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

要创建的生成器的类型。The type of the builder to create.

参数

configureDelegate
Action<HostBuilderContext,TContainerBuilder>

配置将用于构造主机的 IConfigurationIConfigurationBuilder 的委托。The delegate for configuring the IConfigurationBuilder that will be used to construct the IConfiguration for the host.

返回

IHostBuilder

用于链接的相同 IHostBuilder 实例。The same instance of the IHostBuilder for chaining.

实现

适用于