如果衍生表格具有一个综合的主要关键点,实体框架4中是否有“按类型分列的”继承?
下面是我的表格:
TABLE: ConfigurationKey (Base Entity)
PK: Id
TABLE: ConfigurationKey_Device (Derived Entity)
PK: ConfigurationKeyId (FK to ConfigurationKey.Id)
PK: DeviceId (FK to Device.Id)
就其价值而言,碎块是抽象的,其他类型则来自混凝土。
我使用EF设计师:
- Added the inheritance rule
- Deleted ConfigurationKeyId from ConfigurationKey_Device
- Deleted the FK linking ConfigurationKey_Device to ConfigurationKey
- Updated the mapping of the ConfigurationKey_Device.ConfigurationKeyId column to the inherited Id property.
我现在发现的错误是:
Error 3003: Problem in mapping fragments starting at line xxx:All the key properties (ConfigurationKeys.Id) of the EntitySet ConfigurationKeys must be mapped to all the key properties (ConfigurationKey_Device.ConfigurationKeyId, ConfigurationKey_Device.DeviceId) of table ConfigurationKey_Device.
Thanks, Chris