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
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: RegistrationA new Registration instance.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | Thrown when on of the supplied arguments is a null reference. |
See Also