Tag: reflection

检查一个类是否从generics类派生

我有我的派生类项目中的generics类。 public class GenericClass<T> : GenericInterface<T> { } public class Test : GenericClass<SomeType> { } 有没有什么办法来找出一个Type对象是从GenericClass派生? t.IsSubclassOf(typeof(GenericClass<>)) 不起作用。