HostingHostBuilderExtensions.UseDefaultServiceProvider 方法

定義

多載

UseDefaultServiceProvider(IHostBuilder, Action<ServiceProviderOptions>)

IServiceProvider 指定為預設值。Specify the IServiceProvider to be the default one.

UseDefaultServiceProvider(IHostBuilder, Action<HostBuilderContext,ServiceProviderOptions>)

IServiceProvider 指定為預設值。Specify the IServiceProvider to be the default one.

UseDefaultServiceProvider(IHostBuilder, Action<ServiceProviderOptions>)

IServiceProvider 指定為預設值。Specify the IServiceProvider to be the default one.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Hosting::IHostBuilder ^ UseDefaultServiceProvider(Microsoft::Extensions::Hosting::IHostBuilder ^ hostBuilder, Action<Microsoft::Extensions::DependencyInjection::ServiceProviderOptions ^> ^ configure);
public static Microsoft.Extensions.Hosting.IHostBuilder UseDefaultServiceProvider (this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder, Action<Microsoft.Extensions.DependencyInjection.ServiceProviderOptions> configure);
static member UseDefaultServiceProvider : Microsoft.Extensions.Hosting.IHostBuilder * Action<Microsoft.Extensions.DependencyInjection.ServiceProviderOptions> -> Microsoft.Extensions.Hosting.IHostBuilder
<Extension()>
Public Function UseDefaultServiceProvider (hostBuilder As IHostBuilder, configure As Action(Of ServiceProviderOptions)) As IHostBuilder

參數

hostBuilder
IHostBuilder

要設定的 IHostBuilderThe IHostBuilder to configure.

傳回

IHostBuilder

IHostBuilderThe IHostBuilder.

適用於

UseDefaultServiceProvider(IHostBuilder, Action<HostBuilderContext,ServiceProviderOptions>)

IServiceProvider 指定為預設值。Specify the IServiceProvider to be the default one.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Hosting::IHostBuilder ^ UseDefaultServiceProvider(Microsoft::Extensions::Hosting::IHostBuilder ^ hostBuilder, Action<Microsoft::Extensions::Hosting::HostBuilderContext ^, Microsoft::Extensions::DependencyInjection::ServiceProviderOptions ^> ^ configure);
public static Microsoft.Extensions.Hosting.IHostBuilder UseDefaultServiceProvider (this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder, Action<Microsoft.Extensions.Hosting.HostBuilderContext,Microsoft.Extensions.DependencyInjection.ServiceProviderOptions> configure);
static member UseDefaultServiceProvider : Microsoft.Extensions.Hosting.IHostBuilder * Action<Microsoft.Extensions.Hosting.HostBuilderContext, Microsoft.Extensions.DependencyInjection.ServiceProviderOptions> -> Microsoft.Extensions.Hosting.IHostBuilder
<Extension()>
Public Function UseDefaultServiceProvider (hostBuilder As IHostBuilder, configure As Action(Of HostBuilderContext, ServiceProviderOptions)) As IHostBuilder

參數

hostBuilder
IHostBuilder

要設定的 IHostBuilderThe IHostBuilder to configure.

configure
Action<HostBuilderContext,ServiceProviderOptions>

設定 IServiceProvider 的委派。The delegate that configures the IServiceProvider.

傳回

IHostBuilder

IHostBuilderThe IHostBuilder.

適用於