I need to register multiple concrete objects with a different service
injection. So for example
container.Register(Component.For(Of InterfaceA) _
.ImplementedBy(GetType(ConcreteA)) _
.ServiceOverrides(ServiceOverride.ForKey("dependency").Eq("DependencyConcreteA")))
container.Register(Component.For(Of InterfaceA) _
.ImplementedBy(GetType(ConcreteA)) _
.ServiceOverrides(ServiceOverride.ForKey("dependency").Eq("DependencyConcreteB")))
container.Register(Component.For(Of InterfaceA) _
.ImplementedBy(GetType(ConcreteA)) _
.ServiceOverrides(ServiceOverride.ForKey("dependency").Eq("DependencyConcreteC")))
So I've got 4 concrete implementations that are the same except for
what they are injected with. This is not working, when I get to the
second Register statement I get an error that "An item with the same
key has already been added.". Is there a way to do this?
Thanks,
Ryan
--
You received this message because you are subscribed to the Google Groups
"Castle Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en.