views:

17

answers:

1

Hi, I know I can, in Structuremap, do this:

var container = new Container(cfg =>
{
    cfg.For(typeof (IDomainDataRepository<>)).Use(typeof (DomainDataRepository<>));
});

but what if my Interface has 2 type parameters:

IDomainDataRepository<T,TKey> instead ofIDomainDataRepository<T>

How to tell Structuremap to instantiate this type of classes?

+1  A: 

Ok, I figured it out.

var container = new Container(cfg =>
{
    cfg.For(typeof(IDomainDataRepository<,>)).Use(typeof(DomainDataRepository<,>));
});
Luka