Well I'll try to explain.
When IA is being injected into IBs' constructor it's needs to be an existing instance that is being held in some kind of cache. In other words the IA that needs to be injected into IBs' ctor needs to be an existing instance (based on some kind of logic)
and not a new instance.
I thought about using a static factory for the creation of IB,, however IBs' interface is actually a little different from what was posted above. It's actually
IB<T> where T : class. Therefore using a static factory (using the static factory extension) would require more lines of code when registering types into the unity container. Let's say I have a IPerson class and an IEmployee interface
then I would have to register each one separately like this:
And that's because there's no overload for register factory that has a type to build as a parameter.
Thanks for the help.