HostBuilder.UseServiceProviderFactory 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
UseServiceProviderFactory<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder>)
覆寫用來建立服務提供者的 Factory。
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。
傳回
用於鏈結的相同 IHostBuilder 執行個體。
實作
適用於
UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext,IServiceProviderFactory<TContainerBuilder>>)
覆寫用來建立服務提供者的 Factory。
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>>
用於建立服務提供者的 Factory。
傳回
用於鏈結的相同 IHostBuilder 執行個體。