我有这样的通用类:
public class MyClass<T>
where T : class
{
// method in here...
}
我尝试让这个类继承另一个类,如下所示:
public class MyClass<T>
where T : class
: BaseMyClass
{
// method in here...
}
但是没有成功。
泛型类是否可以从另一个类派生?以及如何做到这一点?
最佳答案
public class MyClass<T> : BaseMyClass where T : class
{
// method in here...
}
关于c# - 在通用类上添加继承类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26228379/