2010-09-21 42 views
3

我正在制作OData服务并使用EDM来映射我的数据库结构并指定表之间的关联并创建导航属性。EDM协会的问题

我已经使用向导将我的表导入EDM。事情编好,直到我把协会。我相信我之前可以做到这一点,但由于某种原因,它已经搞砸了。

我有一个表属性

AttributeId  int PK 
AttributeName varchar(100) 

AttributeItem 
AttributeItemId  int PK 
AttributeID   int 
AttrributeItemValue varchar(100) 

我想用一个0..1到*关系(从属性到AttributeItem)两个表之间的链接属性ID。

我经常遇到问题。最初这个错误:

Error 3027: No mapping specified for the following EntitySet/AssociationSet - AttibuteAttributeItem

然后,一旦我与联想我得到这个错误的映射细节拨弄:

Error 3024: Problem in mapping fragments starting at line 91: Must specify mapping for all key properties (AttributeItemId, AttributeId) of End AttributeItem in Relationship AttributeAttributeItem.

我不知道为什么它这样做。

任何想法我失踪?

感谢,

回答

1

上Assotiation链接双击并设置引用约束。它不应该是空的。之后使用“生成数据库”更新EDM模型内部。 也考虑右键单击解决方案exprorer中的edmx文件并选择“打开方式...”,然后使用XML编辑器打开它以查看错误行(91)。