Cannot resolve Symbol ObjectStateManager

跟風遠走 提交于 2019-12-05 00:12:35

I am sure you found a solution by now but I ran into the same issue just now and was able to resolve it by changing the EntityState line to the following:

db.Entry(user).State = EntityState.Modified;

Probably you are using code first EF. In this case you have to revert yours code to explicit implemenatation of IObjectContextAdapter, i.e.

((IObjectContextAdapter)db).ObjectContext.ObjectStateManager

Have you added the System.Data.Entity assembly to the project?

Also System.Data.Objects is correct.

One additional item to check is that the target .net framework for the project is set to .net 4+.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!