我試圖鬆散地耦合這段代碼,但我不知道該如何或者應該如何。 我正在使用實體框架,而DbContext是實體對象TMeasure使用的繼承類。當我運行此代碼時,出現此錯誤: 'System.Data.Entity.DbContext' does not contain a definition for 'TMeasures' and no extension method 'TMeasures' ac
我正在考慮編程接口而不是具體的類,但我有一個疑問:任何接口方法應該能夠保存對具體類的引用嗎? 假設以下情況: 1) public interface AbsType1 {
public boolean method1(int a); // it's ok, only primitive types here
}
2) public interface AbsType2 {