In IOC's what does ResolveAll
do?? I know that the offical answer is "Resolve all valid components that match this type." Does that mean that it will return any class that implements a given interface?
It will return all classes that were registered for a given interface.
...and are not waiting on any references to be resolved. This bit me today!
With Unity, ResolveAll resolves each registered mapping for an interface except for the default mapping.
so if you registered:
container.RegisterType<IInterface, ActualClassOne>(new ContainerControlledLifetimeManager());
container.RegisterType<IInterface, ActualClassOne>("Singleton", new ContainerControlledLifetimeManager());
container.RegisterType<IInterface, ActualClassOne>("Trans", new TransientLifetimeManager());
ResolveAll() will only give you an IEnumerable containing a resolved "Singleton" and "Trans" mappings
It will return all classes that were registered for a given interface.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With