WebHostBuilderExtensions.UseDefaultServiceProvider 方法

定義

多載

UseDefaultServiceProvider(IWebHostBuilder, Action<WebHostBuilderContext,ServiceProviderOptions>)

設定預設服務提供者

UseDefaultServiceProvider(IWebHostBuilder, Action<ServiceProviderOptions>)

設定預設服務提供者

UseDefaultServiceProvider(IWebHostBuilder, Action<WebHostBuilderContext,ServiceProviderOptions>)

設定預設服務提供者

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

參數

hostBuilder
IWebHostBuilder

要設定的 IWebHostBuilder

傳回

IWebHostBuilder

IWebHostBuilder

適用於

UseDefaultServiceProvider(IWebHostBuilder, Action<ServiceProviderOptions>)

設定預設服務提供者

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

參數

hostBuilder
IWebHostBuilder

要設定的 IWebHostBuilder

configure
Action<ServiceProviderOptions>

用來設定 ServiceProviderOptions 預設值的回呼 IServiceProvider

傳回

IWebHostBuilder

IWebHostBuilder

適用於