我不明白這裏發生了什麼,我從另一個項目中複製了這個代碼(編譯沒有問題),但是一旦我把它帶入自己的項目中,我得到了構造函數定義中的編譯器錯誤說該方法需要返回類型。抽象類的構造函數要求返回類型
public abstract class BaseSqlRepository<T, InterfaceT, PrimaryKeyT>
where T : class
where InterfaceT : class
{
protected EvalgridEntities DataContext;
protected BaseSqlRespository(EvalgridEntities db)
{
this.DataContext = db;
}
}
Method must have a return type.
我缺少什麼?
Bah,當我複製/粘貼它時,是怎麼發生的!? ._。 – 2010-07-17 00:36:39
不知道 - 但這是問題(至少,這是如果這是真正的代碼...) – 2010-07-17 00:37:41
你可能粘貼它,並將光標置於某個點的中間,並意外地擊中's'在你的鍵盤上。 – 2010-07-17 00:44:17