SingletonLifestyleCreateRegistration Method (Type, FuncObject, Container)

Simple Injector
Creates a new Registration instance defining the creation of the specified serviceType using the supplied instanceCreator with the caching as specified by this lifestyle.

Namespace:  SimpleInjector.Lifestyles
Assembly:  SimpleInjector (in SimpleInjector.dll) Version: 5.3.0
Syntax

public Registration CreateRegistration(
	Type serviceType,
	Func<Object> instanceCreator,
	Container container
)

Parameters

serviceType
Type: SystemType
The interface or base type that can be used to retrieve the instances.
instanceCreator
Type: SystemFuncObject
The delegate that will be responsible for creating new instances.
container
Type: SimpleInjectorContainer
The Container instance for which a Registration must be created.

Return Value

Type: Registration
A new Registration instance.
Exceptions

ExceptionCondition
ArgumentNullExceptionThrown when on of the supplied arguments is a null reference.
See Also

Reference