简体   繁体   English

实体框架-错误3007映射关系-外键

[英]Entity Framework - Error 3007 Mapping Relationship - Foreign Key

I have two tables, BookmakerTeamNames and XMLSoccer-Team. 我有两个表,BookmakerTeamNames和XMLSoccer-Team。

The relationship is: BookmakerTeamNames 0/1 to 1 XMLSoccer-Team 关系为:BookmakerTeamNames 0/1至1 XMLSoccer-Team

They are linked based on TeamID in Table SoccerTeam and XMLSoccerTeamID in BookmakerTeamNames. 它们基于Table SoccerTeam中的TeamID和BookmakerTeamNames中的XMLSoccerTeamID进行链接。

When I validate my model in EF Designer, I receive error 3007 : Problem in mapping fragments starting at line xxx. 当我在EF Designer中验证模型时,出现错误3007:映射从xxx行开始的片段时出现问题。 Column(s) XMLSoccerTeamID are being mapped in both fragments to different conceptual side properties. 列XMLSoccerTeamID在两个片段中都被映射到不同的概念性副属性。

The relationship doesn't exist in my database, as the FK constraint disallows me from having a NULL value. 该关系在我的数据库中不存在,因为FK约束不允许我使用NULL值。 Hence, the reason for trying to add this association. 因此,尝试添加此关联的原因。

Thanks in advance 提前致谢

To view the SQL Server error log In Object Explorer, expand a server, expand Management, and then expand SQL Server Logs. 查看SQL Server错误日志在对象资源管理器中,依次展开服务器,“管理”和“ SQL Server日志”。 Right-click a log and click View SQL Server Log. 右键单击日志,然后单击“查看SQL Server日志”。 so you can find exact reason about the error. 因此您可以找到有关错误的确切原因。

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

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