Closed SimonG96 closed 4 years ago
For Lifestyle.Singleton
:
Add the registered Type to the _singletons
-list, and not the interface. This way there can be a check if there is already an instance of the type that has to be resolved.
Add MultipleRegistration
s for up to five interfaces:
MultipleRegistration<TInterface1,...,TInterface5>
IOnCreate<TInterface1,...,TInterface5>
IIocContainer.Register<TInterface1,...,TInterface5>
RegistrationFactory.Register<TInterface1,...,TInterface5>
Allow the registration of multiple interfaces for one registered type, e.g.:
The interface
is implemented by
Users may want to get a
IBar
or aIFoo
and both times need the implementing typeFoo
.The registration should look something like this:
For registrations with
Lifestyle.Transient
this could be done by callingIIocContainer.Register<>()
multiple times:What can be done for registrations with
Lifestyle.Singleton
? EveryResolve<>()
call has to return the same instance of the implemented type.