I don't know how it can be done with the xml configuration, but you can
do it with fluent registration (something like this):
Container.Register(Component.For<IThinInterface2>().Instance((IThinInterface2)Container.Resolve<IThinInterface1>())
Tim Barcz wrote:
> public class MyConcreteClass : IThinInterface1, IThinInterface2
> {
> ....
> }
>
> Can I do this with one registration or do I need two?
>
> In and Ideal World (possible???):
>
> <component id="Component1"
> service="MyAssembly.IThinInterface1, Assembly"
> service="MyAssembly.IThinInterface2, Assembly"
> type="MyAssembly.MyConcreteClass Assembly" />
>
> How it's done right now?
>
> <component id="Component1"
> service="MyAssembly.IThinInterface1, Assembly"
> type="MyAssembly.MyConcreteClass Assembly" />
>
>
> <component id="Component2"
> service="MyAssembly.IThinInterface2, Assembly"
> type="MyAssembly.MyConcreteClass Assembly" />
>
>
> The issue if I want a singleton instance but the component
> registration is backed by the same concrete class I would think that
> class would get created twice. Thoughts? Recommendations?
>
> Tim
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Castle Project Development List" 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-devel?hl=en
-~----------~----~----~----~------~----~------~--~---