【发布时间】:2014-03-13 22:39:58
【问题描述】:
我必须更改了导致实体框架中出现异常的某些内容。我不确定它是什么,但我猜我的课程与我的数据库不符。有没有办法准确地找出不符合的地方?
这是一个例外:
An exception of type 'System.InvalidOperationException'
occurred in EntityFramework.dll but was not handled in user code
Additional information:
The model backing the 'SomethingContext' context has changed since
the database was created. Consider using Code First Migrations to
update the database (http://go.microsoft.com/fwlink/?LinkId=238269).
这是代码行:
var results = db.Table.Where(x => !x.IsBool);
【问题讨论】:
-
您从一个上下文中获取了元素,但尝试将其添加到另一个上下文中?
-
不,我只是在查询一个表。生病添加一个例子。
标签: c# .net entity-framework orm