首先使用 EF Db,我有两个表:
Table1: AppId, AppName, AppGuid [PK]
Table2: AppGuid [FK], Description, Url
EF 可以从两者中创建一个实体吗?
意义:
App:
AppId, AppName, AppGuid, Description, Url
更新
谢谢。我提出了看法。将其映射到 EF。现在我收到以下错误:Error 2 Error 111: Properties referred by the Principal Role App must be exactly identical to the key of the EntityType MaMDBModel.App referred to by the Principal Role in the relationship constraint for Relationship MaMDBModel.FK_AppsData_App. Make sure all the key properties are specified in the Principal Role. D:\MaM\Dev\MamAdmin_1.0\MaMDBEntityFramework\MaMModel.edmx 768 11 MaMDBEntityFramework
这是我的 edmx: