I have multiple implementation of ITrace in my code, Each service layer object uses its own ITrace implementation. When I resolve my service layer, I want all objects in graph should resolve based on name in resolving root.
presently I am achieving this by using InectionConstructor like
container.RegisterType<IType2, Type2>("name1", new InjectionConstructor(new ResolvedParameter<IType1>("name1"));
container.RegisterType<IType2, Type2_1>("name2", new InjectionConstructor(new ResolvedParameter<IType1>("name2"));
in second and third line I have to tell that when resolving "name1", all object graph should be resolved on same "name1". Otherwise Unity try to resolve default registration.
Is there a way I can tell unity to resolve all objects in the graph using "name1" registration