inversion-of-control

Registering a generic abstract class in Castle Windsor

百般思念 提交于 2020-12-04 08:14:03
问题 I am trying to register a type by convention, I've simplified my case in this example: public abstract class BaseEntity{} public class EntityA : BaseEntity{} public class EntityB : BaseEntity{} public abstract class BaseClass { //... } public abstract class GenericBaseClass<T> : BaseClass where T : BaseEntity { //.. } public class ConcreteA : GenericBaseClass<EntityA> { //... } public class ConcreteB : GenericBaseClass<EntityB> { //... } I'm trying to find the way to register GenericBaseClass