共用方式為


ServiceCollectionContainerBuilderExtensions.BuildServiceProvider 方法

定義

多載

BuildServiceProvider(IServiceCollection)

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

BuildServiceProvider(IServiceCollection, ServiceProviderOptions)

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

BuildServiceProvider(IServiceCollection, Boolean)

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

BuildServiceProvider(IServiceCollection)

來源:
ServiceCollectionContainerBuilderExtensions.cs
來源:
ServiceCollectionContainerBuilderExtensions.cs
來源:
ServiceCollectionContainerBuilderExtensions.cs
來源:
ServiceCollectionContainerBuilderExtensions.cs
來源:
ServiceCollectionContainerBuilderExtensions.cs

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

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::ServiceProvider ^ BuildServiceProvider(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 -> Microsoft.Extensions.DependencyInjection.ServiceProvider
<Extension()>
Public Function BuildServiceProvider (services As IServiceCollection) As ServiceProvider

參數

services
IServiceCollection

包含服務描述元的 IServiceCollection

傳回

ServiceProvider

適用於

BuildServiceProvider(IServiceCollection, ServiceProviderOptions)

來源:
ServiceCollectionContainerBuilderExtensions.cs
來源:
ServiceCollectionContainerBuilderExtensions.cs
來源:
ServiceCollectionContainerBuilderExtensions.cs
來源:
ServiceCollectionContainerBuilderExtensions.cs
來源:
ServiceCollectionContainerBuilderExtensions.cs

建立包含所提供 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

適用於

BuildServiceProvider(IServiceCollection, Boolean)

來源:
ServiceCollectionContainerBuilderExtensions.cs
來源:
ServiceCollectionContainerBuilderExtensions.cs
來源:
ServiceCollectionContainerBuilderExtensions.cs
來源:
ServiceCollectionContainerBuilderExtensions.cs
來源:
ServiceCollectionContainerBuilderExtensions.cs

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

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::ServiceProvider ^ BuildServiceProvider(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 -> Microsoft.Extensions.DependencyInjection.ServiceProvider
<Extension()>
Public Function BuildServiceProvider (services As IServiceCollection, validateScopes As Boolean) As ServiceProvider

參數

services
IServiceCollection

包含服務描述元的 IServiceCollection

validateScopes
Boolean

true 執行檢查,確認範圍服務永遠不會從根提供者解析;否則 false

傳回

ServiceProvider

適用於