Given the below configuration
Container.Register(Component.For<A>().Named("foo"));
Container.Register(Component.For<B>().Named("foobar"));
Container.Register(
AllTypes.Pick()
.FromAssemblyNamed("MyAssembly")
.If(t => t.Name.EndsWith("ABC"))
.Configure(c => c.LifeStyle.Is(LifestyleType.Transient))
.WithService.Select(i => typeof(I))
);
Container.Register(
AllTypes.Pick()
.FromAssemblyNamed("MyAssembly")
.If(t => t.Name.EndsWith("123"))
.Configure(c => c.LifeStyle.Is(LifestyleType.Transient))
.WithService.Select(i => typeof(I))
);
If I know that the interface "I" exposes a property "P", and that the classes A and B can be assigned to P; how do I explicitly state that the first collection of types from the AllTypes call should have the property P set to the type with id of "foo", and the second collection should have the same property set to the type with the id of "foobar"?
Using XML config this can be done by explicitly setting the parameters using the ${id} notation. I assume its similar in the fluent API.
Thanks.