简体   繁体   English

实体框架多个edmx错误

[英]Entity Framework multiple edmx errors

I have a data model AccordEHR in which I have multiple tables. 我有一个数据模型AccordEHR ,其中有多个表。 I could easily retrieve data using one data model. 我可以使用一种数据模型轻松检索数据。 I used another data model named PayCare which also has multiple tables. 我使用了另一个名为PayCare数据模型,该模型也有多个表。

Now the problem is, in PayCare , there are tables which have name exactly that as in AccordEHR table. 现在的问题是,在PayCare ,有些表的名称与AccordEHR表中的名称完全相同。 There are similar named tables in both data models. 两种数据模型中都有相似的命名表。 When I created the second data model PayCare , the first data model automatically replaces its table with second data model tables which has common name. 当我创建第二个数据模型PayCare ,第一个数据模型自动将其表替换为具有通用名称的第二个数据模型表。

Note that tables have similar names but the data differs. 请注意,表的名称相似,但数据不同。

I tried to explain it as simple as I could. 我试图尽可能简单地解释它。

Put your models into different namespaces by separating them with folders 通过使用文件夹将模型分离到不同的名称空间中

...
  Database
      PayCare
          PayCareEntityModel.edmx
          ...
      AccordEHR
          AccordEHR.edmx
          ...

The CommonTable class for both models are then separated into Database.PayCare.CommonTable and Database.AccordEHR.CommonTable 然后CommonTable两个模型的CommonTable类分离为Database.PayCare.CommonTableDatabase.AccordEHR.CommonTable

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM