HostingHostBuilderExtensions.UseDefaultServiceProvider 方法

定义

重载

UseDefaultServiceProvider(IHostBuilder, Action<HostBuilderContext,ServiceProviderOptions>)

指定要 IServiceProvider 为默认的 。

UseDefaultServiceProvider(IHostBuilder, Action<ServiceProviderOptions>)

指定要 IServiceProvider 为默认的 。

UseDefaultServiceProvider(IHostBuilder, Action<HostBuilderContext,ServiceProviderOptions>)

Source:
HostingHostBuilderExtensions.cs
Source:
HostingHostBuilderExtensions.cs
Source:
HostingHostBuilderExtensions.cs

指定要 IServiceProvider 为默认的 。

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

要配置的 IHostBuilder

configure
Action<HostBuilderContext,ServiceProviderOptions>

用于配置 IServiceProvider 的委托。

返回

IHostBuilder

适用于

UseDefaultServiceProvider(IHostBuilder, Action<ServiceProviderOptions>)

Source:
HostingHostBuilderExtensions.cs
Source:
HostingHostBuilderExtensions.cs
Source:
HostingHostBuilderExtensions.cs

指定要 IServiceProvider 为默认的 。

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

要配置的 IHostBuilder

configure
Action<ServiceProviderOptions>

用于配置 IServiceProvider 的委托。

返回

IHostBuilder

适用于