I have my container configured like following:
container = new UnityContainer()
.RegisterType<IA, A>()
.RegisterType<IB, B>()
.RegisterType<IC, C>(new InjectionConstructor(strA));
What I need is, I want to register another C instance like:
container.RegisterType<IC, C>(new InjectionConstructor(strB));
note the difference between strA and strB.
Both A and B need C. But I want A to use the first C and B to use the second C.
Is there a proper way in Unity to achieve that?
Thanks
You will want to use a named type registration.