HostApplicationBuilder.ConfigureContainer<TContainerBuilder> Method

Definition

Registers a IServiceProviderFactory<TContainerBuilder> instance to be used to create the IServiceProvider.

public void ConfigureContainer<TContainerBuilder> (Microsoft.Extensions.DependencyInjection.IServiceProviderFactory<TContainerBuilder> factory, Action<TContainerBuilder>? configure = default);
abstract member ConfigureContainer : Microsoft.Extensions.DependencyInjection.IServiceProviderFactory<'ContainerBuilder> * Action<'ContainerBuilder> -> unit
override this.ConfigureContainer : Microsoft.Extensions.DependencyInjection.IServiceProviderFactory<'ContainerBuilder> * Action<'ContainerBuilder> -> unit
Public Sub ConfigureContainer(Of TContainerBuilder) (factory As IServiceProviderFactory(Of TContainerBuilder), Optional configure As Action(Of TContainerBuilder) = Nothing)

Type Parameters

TContainerBuilder

The type of builder provided by the IServiceProviderFactory<TContainerBuilder>.

Parameters

configure
Action<TContainerBuilder>

A delegate used to configure the . This delegate can be used to configure services using APIs that are specific to the IServiceProviderFactory<TContainerBuilder> implementation.

Implements

Remarks

This method is called by Build(), and so the delegate specified by configure will run after all other services have been registered.

If you call this method multiple times, the previously stored factory and configure delegates are replaced.

Applies to