编译报错:
Error 1 Constraints for override and explicit interface implementation methods are inherited from the base method, so they cannot be specified directly
这上面的英文说啥呢?
下面是代码片段
public class SQLDataAccess : DataAccess
{
public SQLDataAccess()
{
base.virtualRoomDC = new VirtualRoomDataContext();
}
// public abstract void Add<T>(T item) where T: class; 实现这个方法
public override void Add<T>(T item) where T: class
{
if (this.IsValidated<T>(item))
{
Table<T> table = base.virtualRoomDC.GetTable<T>();
bool itemAlreadyExists = table.Contains<T>(item);
table.InsertOnSubmit(item);
}
}
aluckdog
慕哥6287543
相关分类