What does the DBContext.Entry do?

不想你离开。 提交于 2019-11-29 01:06:59
Parv Sharma

It just attaches the entity to the dataContext. Otherwise you will have to search for the entity using the primary key and then edit the value and save it.

If you have an entity that you know already exists in the database but to which changes may have been made then you can tell the context to attach the entity and set its state to Modified. http://msdn.microsoft.com/en-US/data/jj592676

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