Castle Windsor Map Named Component To Specific Property
问题 Following scenario: We use the Fluent API to register all components in an assembly and two components tyepof(A) with named keys. Another class B with two properties typeof(A) should get the named components injected. Sample: public class A : IA {} public class B : IB { [Named("first")] public IA First { get; set; } [Named("second")] public IA Second { get; set; } } // ... container.Register(Component.For<IA>().Instance(new A(value1)).Named("first")); container.Register(Component.For<IA>()