HostBuilder.UseServiceProviderFactory 方法

定义

重载

UseServiceProviderFactory<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder>)

重写用于创建服务提供程序的工厂。Overrides the factory used to create the service provider.

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

重写用于创建服务提供程序的工厂。Overrides the factory used to create the service provider.

UseServiceProviderFactory<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder>)

重写用于创建服务提供程序的工厂。Overrides the factory used to create the service provider.

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

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

参数

factory
IServiceProviderFactory<TContainerBuilder>

用于创建服务提供程序的工厂。A factory used for creating service providers.

返回

IHostBuilder

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

实现

适用于

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

重写用于创建服务提供程序的工厂。Overrides the factory used to create the service provider.

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

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

参数

factory
Func<HostBuilderContext,IServiceProviderFactory<TContainerBuilder>>

用于创建服务提供程序的工厂。A factory used for creating service providers.

返回

IHostBuilder

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

实现

适用于