EF5保持引用不再存在的属性

时间:2014-11-04 02:44:48

标签: entity-framework entity-framework-5

我有一个EF5模型,我重命名了几个表格和字段,因为拼写错了。现在,当我从数据库更新模型时,它会使所有正确的关联和实体以及上下文都发生变化。但我一直在下面得到这个错误。请注意你的领域" BrowserDetailId"不再在任何桌子上或在Fk关系中。我只是在运行时才得到这个错误,我无法找到它认为FK关系仍然存在的地方。

Schema specified is not valid. Errors:   The relationship 'PortalModel.FK_LoginActivity_LoginAttempts' was not loaded because the type 
'PortalModel.LoginAttempt' is not available.  The following information may be useful in resolving the previous error:  
The required property 'BrowserDetailId' does not exist on the type 'Portal.Entities.LoginAttempt'.      
The relationship 'PortalModel.FK_VerificationAttempts_Verification' was not loaded because the type 'PortalModel.Verification' is not available.  
The following information may be useful in resolving the previous error:  
The required property 'BroswerDetailId' does not exist on the type 'Portal.Entities.Verification'. 

我删除了edmx及相关的上下文和实体并重新创建它们,仍然会收到错误。 我删除了与表相关的FK,并更新了edmx模型并仍然得到错误。 我创建了新的edmx文件和上下文,并且仍然会得到错误。 我搜索了解决方案中的所有文件,无法找到" BrowserDetailId"。

我一直试图想出更多时间,然后我想承认,任何帮助都会很棒。

数据库是SQL Server 2008

0 个答案:

没有答案