HostBuilder.UseServiceProviderFactory 方法

定义

重载

UseServiceProviderFactory<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder>)

重写用于创建服务提供程序的工厂。

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

重写用于创建服务提供程序的工厂。

UseServiceProviderFactory<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder>)

Source:
HostBuilder.cs
Source:
HostBuilder.cs

重写用于创建服务提供程序的工厂。

public:
generic <typename TContainerBuilder>
 virtual 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
override this.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>

用于创建服务提供程序的工厂。

返回

用于链接的相同 IHostBuilder 实例。

实现

适用于

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

Source:
HostBuilder.cs
Source:
HostBuilder.cs

重写用于创建服务提供程序的工厂。

public:
generic <typename TContainerBuilder>
 virtual 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
override this.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>>

用于创建服务提供程序的工厂。

返回

用于链接的相同 IHostBuilder 实例。

实现

适用于