Initializes a new instance of the Registration class.
Namespace: SimpleInjector
Assembly: SimpleInjector (in SimpleInjector.dll) Version: 5.3.0
Syntax
protected Registration( Lifestyle lifestyle, Container container, Type implementationType, Func<Object> instanceCreator = null )
Parameters
- lifestyle
- Type: SimpleInjectorLifestyle
The Lifestyle this that created this registration. - container
- Type: SimpleInjectorContainer
The Container instance for this registration. - implementationType
- Type: SystemType
The type of instance that will be created. - instanceCreator (Optional)
- Type: SystemFuncObject
The optional delegate supplied by the user that allows building or creating new instances. If this argument is supplied, the Expression and FuncTResult instances build by this Registration instance wrap that delegate. When the delegate is omitted, the built expressions and delegates invoke the implementationType's constructor.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | Thrown when one of the supplied arguments is a null reference. |
See Also