我试图松散地耦合这段代码,但我不知道该如何或者应该如何。 我正在使用实体框架,而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 {