WebHostBuilderExtensions.UseDefaultServiceProvider 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
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。
- configure
- Action<WebHostBuilderContext,ServiceProviderOptions>
用來 ServiceProviderOptions 設定預設 IServiceProvider 之 的回呼。
傳回
適用於
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 之 的回呼。