Check if an insert or update was successful in Entity Framework

十年热恋 提交于 2019-12-01 17:36:07

Yes, if there is no exception you may assume that the statements executed successfully.

Maybe this is not direct answer to the question, but may help. By default all commands are encapsulated in one DbTransaction when SaveChanges method is called (Julia Lerman, Programming Entity Framework). So, or all commands will be successfully executed, or neither. That's one way to know if insert, or update or delete was successful.

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