【发布时间】:2012-07-23 15:56:06
【问题描述】:
我有两张桌子。一个是Request,另一个是Response。每个请求都有一个对Response 记录的可为空外键引用。
每条Response 记录都有一个不可为空外键引用到它所来自的Request 条目。
我正在尝试为此模型生成实体,但验证失败并出现错误:Multiplicity is not valid in role Response [...]. Because the dependent role properties are not the key properties, the upper bound of the multiplicity of the dependent role must be *。
失败的映射:
请求 -[0..1]-> 响应
响应 -[1]-> 请求
为什么这不起作用?我知道 EF 不太喜欢外键,但这似乎很简单。
【问题讨论】:
标签: c# wcf sql-server-2008 entity-framework