HostingHostBuilderExtensions.UseDefaultServiceProvider 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
UseDefaultServiceProvider(IHostBuilder, Action<HostBuilderContext,ServiceProviderOptions>)
指定要 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 的委托。
返回
适用于
UseDefaultServiceProvider(IHostBuilder, Action<ServiceProviderOptions>)
指定要 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 的委托。