这不可能吗?我明白了
T is not valid in this context.
public static class SQLDynamicData<T>
{
public static List<T> SQLDataList;
static SQLDynamicData()
{
SQLDataList<T> = new List<T>();
}
}
最佳答案
您不需要第一个 <T>
在作业中:
SQLDataList<T> = new List<T>();
应该是:
SQLDataList = new List<T>();
关于c# - 在构造函数中初始化静态泛型列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35003678/