views:

25

answers:

0

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.