Castle Windsor Ioc Resolving Generic classes in the web.config
Asked Answered
S

1

6

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.

Submarginal answered 24/5, 2009 at 0:40 Comment(0)
V
10
<component id="FooRetriever" service="Namespace.IRetrievable`2[[Namespace.Foo, Assembly],[System.String]], Assembly" type="Namespace.FooRetriever, Assembly" />
Valorous answered 24/5, 2009 at 1:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.