共用方式為


IHostBuilder.UseServiceProviderFactory 方法

定義

多載

UseServiceProviderFactory<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder>)

覆寫用來建立服務提供者的 Factory。

UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext,IServiceProviderFactory<TContainerBuilder>>)

覆寫用來建立服務提供者的 Factory。

UseServiceProviderFactory<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder>)

來源:
IHostBuilder.cs
來源:
IHostBuilder.cs
來源:
IHostBuilder.cs

覆寫用來建立服務提供者的 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
IServiceProviderFactory<TContainerBuilder>

要登錄的 Factory。

傳回

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

適用於

UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext,IServiceProviderFactory<TContainerBuilder>>)

來源:
IHostBuilder.cs
來源:
IHostBuilder.cs
來源:
IHostBuilder.cs

覆寫用來建立服務提供者的 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 執行個體。

適用於