ContainerRegister Method (Type)

Simple Injector
Registers that a new instance of concreteType will be returned every time it is requested (transient).

Namespace:  SimpleInjector
Assembly:  SimpleInjector (in SimpleInjector.dll) Version: 4.0.0
Syntax

public void Register(
	Type concreteType
)

Parameters

concreteType
Type: SystemType
The concrete type that will be registered.
Exceptions

ExceptionCondition
ArgumentNullExceptionThrown when concreteType is a null references (Nothing in VB).
ArgumentExceptionThrown when concreteType represents an open generic type or is a type that can not be created by the container.
InvalidOperationException Thrown when this container instance is locked and can not be altered, or when an the concreteType has already been registered.
Remarks

This method uses the container's LifestyleSelectionBehavior to select the exact lifestyle for the specified type. By default this will be Transient.
See Also

Reference