I do not know how to describe it well, but here.
I have 4 classes: A, B, C, D.
A is administered B, C, D
C is introduced D
A - for the decision.
B - singleton.
C and D I do not know.
I want A and C to use the same instance of D, so every time I allow A from the container, D needs to be created once and entered in both A and C.
The easiest way is to simply pass D to C without using Unity. But is there a way to do this with Oneness? I use ContainerControlledLifetimeManager and PerResolveLifetimeManager and never a child container, which I suspect might be useful. I will play a little with this, but it turns out pretty dirty. Can this be done easily?
source
share