Registers a Registration that describes the creation of instances of the type
expressed by the UnregisteredServiceType for this and future requests. The
registration will be cached and future requests will directly call unon that registration, the
expression that it generates or the delegate that gets compiled from that expression.
Namespace: SimpleInjector
Assembly: SimpleInjector (in SimpleInjector.dll) Version: 5.3.0
Syntax
Parameters
- registration
- Type: SimpleInjectorRegistration
The registration that describes the creation of instances according to the registration's lifestyle of the type expressed by the UnregisteredServiceType.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | Thrown when the registration is a null reference. |
ArgumentException | Thrown when the registration is a not exactly of type FuncTResult where T equals the UnregisteredServiceType. |
ActivationException | Thrown when multiple observers that have registered to the ResolveUnregisteredType event called this method for the same type. |
See Also