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: 5.3.0
Syntax

public void InitializeInstance(
	Object instance
)

Parameters

instance
Type: SystemObject
The instance to initialize.
Exceptions

ExceptionCondition
ArgumentNullExceptionThrown when instance is a null reference.
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