Castle Windsor - how to resolve components based on constructor parameters
问题 Say I have a component like this public class MyComponent { public MyComponent(string name) { } } I basically want to have the provided constructor parameters behave as part of the component identifier when resolving it. If you've never resolved it with that set of parameters, it will instantiate a new one. In other words, I want to somehow modify the following test to succeed: IWindsorContainer container = new WindsorContainer(); container.Register(Component.For<MyComponent>()); MyComponent