我终于开始检查最新的 EF 版本,但我的测试遇到了一些麻烦。
因此,我的 DAL 层包含我的 .EDMX 文件,并且我正在使用 MS POCO 模板,因此我也有生成的 .TT 文件和类。
我在我创建的 TestProject.DAL 中有一个通用基类,这些类派生自这些类。IE
public class BaseEntity<T> {}
public class Customer : BaseEntity<Customer> {}
public class Product : BaseEntity<Product> {}
然后在我的 TestProject.BLL 层我有一些派生类即
public class TestProject.BLL.Customer : TestProject.DAL.Customer {}
public class TestProject.BLL.Product : TestProject.DAL.Product {}
然后,在我的 UI 层中,我调用了我的 BLL.Customer 对象。我收到一条错误消息,指出未添加对 DAL.Customer 对象的引用等。
我从我的 UI 项目中引用了 BLL 项目,从我的 BLL 项目中引用了 DAL。
为什么 UI 层在该项目中未引用 DAL 层时抱怨它知道 DAL 层?
另外,作为一个附带问题,这看起来像一个“好”的设计吗?
谢谢大家!鹅