ServiceCollectionContainerBuilderExtensions.BuildServiceProvider ServiceCollectionContainerBuilderExtensions.BuildServiceProvider ServiceCollectionContainerBuilderExtensions.BuildServiceProvider Method

Definition

Overloads

BuildServiceProvider(IServiceCollection) BuildServiceProvider(IServiceCollection) BuildServiceProvider(IServiceCollection)

Creates a ServiceProvider containing services from the provided IServiceCollection.

BuildServiceProvider(IServiceCollection, ServiceProviderOptions) BuildServiceProvider(IServiceCollection, ServiceProviderOptions) BuildServiceProvider(IServiceCollection, ServiceProviderOptions)

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

BuildServiceProvider(IServiceCollection, Boolean) BuildServiceProvider(IServiceCollection, Boolean) BuildServiceProvider(IServiceCollection, Boolean)

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

BuildServiceProvider(IServiceCollection) BuildServiceProvider(IServiceCollection) BuildServiceProvider(IServiceCollection)

Creates a ServiceProvider containing services from the provided IServiceCollection.

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
Parameters
services
IServiceCollection IServiceCollection IServiceCollection

The IServiceCollection containing service descriptors.

Returns

BuildServiceProvider(IServiceCollection, ServiceProviderOptions) BuildServiceProvider(IServiceCollection, ServiceProviderOptions) BuildServiceProvider(IServiceCollection, ServiceProviderOptions)

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

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 IServiceCollection IServiceCollection

The IServiceCollection containing service descriptors.

options
ServiceProviderOptions ServiceProviderOptions ServiceProviderOptions

Configures various service provider behaviors.

Returns

BuildServiceProvider(IServiceCollection, Boolean) BuildServiceProvider(IServiceCollection, Boolean) BuildServiceProvider(IServiceCollection, Boolean)

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

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
Parameters
services
IServiceCollection IServiceCollection IServiceCollection

The IServiceCollection containing service descriptors.

validateScopes
Boolean Boolean Boolean

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

Returns

Applies to