共用方式為


HostingHostBuilderExtensions.ConfigureContainer<TContainerBuilder> 方法

定義

能夠設定具現化的相依性容器。 這可以呼叫多次,結果會進行累加。

public:
generic <typename TContainerBuilder>
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Hosting::IHostBuilder ^ ConfigureContainer(Microsoft::Extensions::Hosting::IHostBuilder ^ hostBuilder, Action<TContainerBuilder> ^ configureDelegate);
public static Microsoft.Extensions.Hosting.IHostBuilder ConfigureContainer<TContainerBuilder> (this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder, Action<TContainerBuilder> configureDelegate);
static member ConfigureContainer : Microsoft.Extensions.Hosting.IHostBuilder * Action<'ContainerBuilder> -> Microsoft.Extensions.Hosting.IHostBuilder
<Extension()>
Public Function ConfigureContainer(Of TContainerBuilder) (hostBuilder As IHostBuilder, configureDelegate As Action(Of TContainerBuilder)) As IHostBuilder

類型參數

TContainerBuilder

產生器的型別。

參數

hostBuilder
IHostBuilder

要設定的 IHostBuilder

configureDelegate
Action<TContainerBuilder>

用於設定 TContainerBuilder 的委派。

傳回

用於鏈結的相同 IHostBuilder 執行個體。

適用於