ServiceCollectionContainerBuilderExtensions.BuildServiceProvider 方法

定義

多載

BuildServiceProvider(IServiceCollection)

從所提供 IServiceCollection 建立包含服務的 ServiceProvider

BuildServiceProvider(IServiceCollection, ServiceProviderOptions)

從所提供 IServiceCollection 建立包含服務的 ServiceProvider,選擇性地啟用服務建立和範圍驗證。

BuildServiceProvider(IServiceCollection, Boolean)

從所提供 IServiceCollection 建立包含服務的 ServiceProvider,選擇性地啟用範圍驗證。

BuildServiceProvider(IServiceCollection)

從所提供 IServiceCollection 建立包含服務的 ServiceProvider

public:
[System::Runtime::CompilerServices::Extension]
 static IServiceProvider ^ BuildServiceProvider(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::ServiceProvider ^ BuildServiceProvider(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
public static IServiceProvider BuildServiceProvider (this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
public static Microsoft.Extensions.DependencyInjection.ServiceProvider BuildServiceProvider (this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
static member BuildServiceProvider : Microsoft.Extensions.DependencyInjection.IServiceCollection -> IServiceProvider
static member BuildServiceProvider : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.ServiceProvider
<Extension()>
Public Function BuildServiceProvider (services As IServiceCollection) As IServiceProvider
<Extension()>
Public Function BuildServiceProvider (services As IServiceCollection) As ServiceProvider

參數

services
IServiceCollection

包含服務描述項的 IServiceCollection

傳回

IServiceProvider
ServiceProvider

ServiceProvider

適用於

BuildServiceProvider(IServiceCollection, ServiceProviderOptions)

從所提供 IServiceCollection 建立包含服務的 ServiceProvider,選擇性地啟用服務建立和範圍驗證。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::ServiceProvider ^ BuildServiceProvider(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Microsoft::Extensions::DependencyInjection::ServiceProviderOptions ^ options);
public static Microsoft.Extensions.DependencyInjection.ServiceProvider BuildServiceProvider (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Microsoft.Extensions.DependencyInjection.ServiceProviderOptions options);
static member BuildServiceProvider : Microsoft.Extensions.DependencyInjection.IServiceCollection * Microsoft.Extensions.DependencyInjection.ServiceProviderOptions -> Microsoft.Extensions.DependencyInjection.ServiceProvider
<Extension()>
Public Function BuildServiceProvider (services As IServiceCollection, options As ServiceProviderOptions) As ServiceProvider

參數

services
IServiceCollection

包含服務描述項的 IServiceCollection

options
ServiceProviderOptions

設定各種服務提供者行為,包括服務建立和範圍驗證。

傳回

ServiceProvider

ServiceProvider

適用於

BuildServiceProvider(IServiceCollection, Boolean)

從所提供 IServiceCollection 建立包含服務的 ServiceProvider,選擇性地啟用範圍驗證。

public:
[System::Runtime::CompilerServices::Extension]
 static IServiceProvider ^ BuildServiceProvider(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, bool validateScopes);
public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::ServiceProvider ^ BuildServiceProvider(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, bool validateScopes);
public static IServiceProvider BuildServiceProvider (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, bool validateScopes);
public static Microsoft.Extensions.DependencyInjection.ServiceProvider BuildServiceProvider (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, bool validateScopes);
static member BuildServiceProvider : Microsoft.Extensions.DependencyInjection.IServiceCollection * bool -> IServiceProvider
static member BuildServiceProvider : Microsoft.Extensions.DependencyInjection.IServiceCollection * bool -> Microsoft.Extensions.DependencyInjection.ServiceProvider
<Extension()>
Public Function BuildServiceProvider (services As IServiceCollection, validateScopes As Boolean) As IServiceProvider
<Extension()>
Public Function BuildServiceProvider (services As IServiceCollection, validateScopes As Boolean) As ServiceProvider

參數

services
IServiceCollection

包含服務描述項的 IServiceCollection

validateScopes
Boolean

true 以執行檢查,以確認已設定範圍的服務永遠不會從根提供者取得解析;否則為 false

傳回

IServiceProvider
ServiceProvider

ServiceProvider

適用於