Table of Contents

Interface IDependencyContainerBuilder

Namespace
Mokkit.Containers
Assembly
Mokkit.dll

Defines the contract for building dependency injection containers with a multiphase initialization lifecycle. This interface supports a structured build process: PreInit → Init → PreBuild → Build.

public interface IDependencyContainerBuilder

Methods

Build(ITestHostBagAccessor)

Builds the final dependency injection container using the specified bag accessor. This is the final phase that produces the configured container instance.

IDependencyContainer Build(ITestHostBagAccessor bagAccessor)

Parameters

bagAccessor ITestHostBagAccessor

The test host bag accessor for accessing shared test resources.

Returns

IDependencyContainer

A configured Mokkit.Containers.IDependencyContainer instance.

Init()

Performs the main initialization phase of the container builder. This phase typically configures services and dependencies.

Task Init()

Returns

Task

A task representing the asynchronous initialization operation.

PreBuild(IDependencyContainerBuilder[])

Performs the pre-build phase of the container builder. This phase allows for cross-builder coordination and final configuration before building.

Task PreBuild(IDependencyContainerBuilder[] builders)

Parameters

builders IDependencyContainerBuilder[]

An array of all container builders participating in the build process.

Returns

Task

A task representing the asynchronous pre-build operation.

PreInit()

Performs the pre-initialization phase of the container builder. This phase typically handles early setup tasks before the main initialization.

Task PreInit()

Returns

Task

A task representing the asynchronous pre-initialization operation.

TryGetCollection<TCollection>()

Attempts to retrieve a collection of the specified type from the builder. This method is used for accessing builder-specific collections during the build process.

TCollection? TryGetCollection<TCollection>() where TCollection : class

Returns

TCollection?

The requested collection, or null if not available.

Type Parameters

TCollection

The type of collection to retrieve. Must be a reference type.