Well so I just added .Named("X") and named them all differently and
this appears to work.

On Jul 28, 9:48 am, Ryan <[email protected]> wrote:
> 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("DependencyConcre­teA")))
>             container.Register(Component.For(Of InterfaceA) _
>                                .ImplementedBy(GetType(ConcreteA)) _
>                                
> .ServiceOverrides(ServiceOverride.ForKey("dependency").Eq("DependencyConcre­teB")))
>             container.Register(Component.For(Of InterfaceA) _
>                                .ImplementedBy(GetType(ConcreteA)) _
>                                
> .ServiceOverrides(ServiceOverride.ForKey("dependency").Eq("DependencyConcre­teC")))
>
> 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.

Reply via email to