I\'m using C# with Microsoft\'s Unity framework. I\'m not quite sure how to solve this problem. It probably has something to do with my lack of understanding DI with Unity.<
One way to solve this would be to use an injection constructor with a named registration.
// Register timmy this way
Person son = new Person("Timmy");
container.RegisterInstance("son", son);
// OR register timmy this way
container.RegisterType("son", new InjectionConstructor("Timmy"));
// Either way, register bus this way.
container.RegisterType(new InjectionConstructor(container.Resolve("son")));
// Repeat for Joe / Train