我有这样的通用类:
public class MyClass<T>
where T : class
{
// method in here...
}
我尝试让这个类继承自另一个类,如下所示:
public class MyClass<T>
where T : class
: BaseMyClass
{
// method in here...
}
但它不起作用。
是否可能从另一个类派生泛型类?以及如何做到这一点?
答案 0 :(得分:4)
public class MyClass<T> : BaseMyClass where T : class
{
// method in here...
}