ServiceCollectionContainerBuilderExtensions.BuildServiceProvider Method

Definition

Overloads

BuildServiceProvider(IServiceCollection)

Creates a ServiceProvider containing services from the provided IServiceCollection.

BuildServiceProvider(IServiceCollection, ServiceProviderOptions)

Creates a ServiceProvider containing services from the provided IServiceCollection optionally enabling service-creation and scope validation.

BuildServiceProvider(IServiceCollection, Boolean)

Creates a ServiceProvider containing services from the provided IServiceCollection optionally enabling scope validation.

BuildServiceProvider(IServiceCollection)

Creates a ServiceProvider containing services from the provided IServiceCollection.

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

Parameters

services
IServiceCollection

The IServiceCollection containing service descriptors.

Returns

IServiceProvider
ServiceProvider

The ServiceProvider.

Applies to

BuildServiceProvider(IServiceCollection, ServiceProviderOptions)

Creates a ServiceProvider containing services from the provided IServiceCollection optionally enabling service-creation and scope validation.

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

Parameters

services
IServiceCollection

The IServiceCollection containing service descriptors.

options
ServiceProviderOptions

Configures various service provider behaviors including service-creation and scope validation.

Returns

ServiceProvider

The ServiceProvider.

Applies to

BuildServiceProvider(IServiceCollection, Boolean)

Creates a ServiceProvider containing services from the provided IServiceCollection optionally enabling scope validation.

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

Parameters

services
IServiceCollection

The IServiceCollection containing service descriptors.

validateScopes
Boolean

true to perform check verifying that scoped services never gets resolved from root provider; otherwise, false.

Returns

IServiceProvider
ServiceProvider

The ServiceProvider.

Applies to