How to get all possible generic type in StructureMap?

Posted by Soul_Master on Stack Overflow See other posts from Stack Overflow or by Soul_Master
Published on 2010-03-12T08:42:19Z Indexed on 2010/03/12 8:47 UTC
Read the original article Hit count: 146

Filed under:
|
|

I just used StructureMap few days ago. I use StructureMap for collecting all validator class like the following code.

public class BaseClassA {}

public class ClassB : BaseClassA {}

public class ClassC : BaseClassB {}

public BaseClassAValidator : IValidator<BaseClassA>() {}

In StructureMap, I only register IValidator interface for BaseClassAValidator class. But I want to get the same result when I call IValidator or IValidator that mean StructureMap should return IValidator where T is requested class or parent class of requested class.

Is it possible? Or I need to manually call it.

© Stack Overflow or respective owner

Related posts about structuremap

Related posts about generics