DI.register

Stores the provided instance of type T in the DI container. This registered instance will be injected for dependencies of type T.

This function can be used to supply instances of types the DI framework cannot construct on its own for further use by the DI.

Nonetheless, types must be supported dependency types.

Overrides a previously stored instance if applicable.
class DI
@safe pure nothrow
void
register
(
T
)
()

See Also

registerInterface to setup which implementation class (resp. instance) to inject for dependencies that specify an interface instead of a concrete type.

Meta