Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Castle Windsor Ioc Resolving Generic classes in the web.config

I have an interface declared as

IRetrievable<T, idT>

where T is the retrieved type and IdT is the argument passed.

How do I configure the castle windsor IoC container to resolve that to a specfic Implementation. Such as a class defined as

FooRetriever : IRetrievable<Foo, string>

I found an example that showed how to resolve a single argument generic:

<component id="FooRetriever" service="Namespace.IRetrievable'1[[Namespace.Foo, Assembly]], Assembly" type="Namespace.FooRetriever, Assembly" />

However I can't figure out how to to accept 2 generic arguments (T, idT) instead of just one.

like image 636
ebrown Avatar asked May 24 '09 00:05

ebrown


1 Answers

<component id="FooRetriever" service="Namespace.IRetrievable`2[[Namespace.Foo, Assembly],[System.String]], Assembly" type="Namespace.FooRetriever, Assembly" />
like image 104
gcores Avatar answered Nov 15 '22 06:11

gcores