RegistrationInitializeInstance Method

Simple Injector
Initializes an already created instance and applies properties and initializers to that instance.

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

public void InitializeInstance(
	Object instance
)

Parameters

instance
Type: SystemObject
The instance to initialize.
Exceptions

ExceptionCondition
ArgumentNullExceptionThrown when instance is a null reference (Nothing in VB).
ArgumentExceptionThrown when the supplied instance is not of type ImplementationType.
Remarks

This method is especially useful in integration scenarios where the given platform is in control of creating certain types. By passing the instance created by the platform to this method, the container is still able to apply any properties (as defined using a custom IPropertySelectionBehavior) and by applying any initializers.
See Also

Reference