UnregisteredTypeEventArgsRegister Method (Registration)

Simple Injector
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: 4.0.0
Syntax

public void Register(
	Registration registration
)

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

ExceptionCondition
ArgumentNullExceptionThrown when the registration is a null reference.
ArgumentExceptionThrown when the registration is a not exactly of type FuncTResult where T equals the UnregisteredServiceType.
ActivationExceptionThrown when multiple observers that have registered to the ResolveUnregisteredType event called this method for the same type.
See Also

Reference