IHostBuilder.UseServiceProviderFactory 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
UseServiceProviderFactory<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder>)
覆寫用來建立服務提供者的 Factory。
public:
generic <typename TContainerBuilder>
Microsoft::Extensions::Hosting::IHostBuilder ^ UseServiceProviderFactory(Microsoft::Extensions::DependencyInjection::IServiceProviderFactory<TContainerBuilder> ^ factory);
public Microsoft.Extensions.Hosting.IHostBuilder UseServiceProviderFactory<TContainerBuilder> (Microsoft.Extensions.DependencyInjection.IServiceProviderFactory<TContainerBuilder> factory);
abstract member UseServiceProviderFactory : Microsoft.Extensions.DependencyInjection.IServiceProviderFactory<'ContainerBuilder> -> Microsoft.Extensions.Hosting.IHostBuilder
Public Function UseServiceProviderFactory(Of TContainerBuilder) (factory As IServiceProviderFactory(Of TContainerBuilder)) As IHostBuilder
類型參數
- TContainerBuilder
產生器的類型。
參數
要登錄的 Factory。
傳回
用於鏈結的相同 IHostBuilder 執行個體。
適用於
UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext,IServiceProviderFactory<TContainerBuilder>>)
覆寫用來建立服務提供者的 Factory。
public:
generic <typename TContainerBuilder>
Microsoft::Extensions::Hosting::IHostBuilder ^ UseServiceProviderFactory(Func<Microsoft::Extensions::Hosting::HostBuilderContext ^, Microsoft::Extensions::DependencyInjection::IServiceProviderFactory<TContainerBuilder> ^> ^ factory);
public Microsoft.Extensions.Hosting.IHostBuilder UseServiceProviderFactory<TContainerBuilder> (Func<Microsoft.Extensions.Hosting.HostBuilderContext,Microsoft.Extensions.DependencyInjection.IServiceProviderFactory<TContainerBuilder>> factory);
abstract member UseServiceProviderFactory : Func<Microsoft.Extensions.Hosting.HostBuilderContext, Microsoft.Extensions.DependencyInjection.IServiceProviderFactory<'ContainerBuilder>> -> Microsoft.Extensions.Hosting.IHostBuilder
Public Function UseServiceProviderFactory(Of TContainerBuilder) (factory As Func(Of HostBuilderContext, IServiceProviderFactory(Of TContainerBuilder))) As IHostBuilder
類型參數
- TContainerBuilder
產生器的類型。
參數
- factory
- Func<HostBuilderContext,IServiceProviderFactory<TContainerBuilder>>
要登錄的 Factory。
傳回
用於鏈結的相同 IHostBuilder 執行個體。