Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我尝试执行 SubmitChanges() 时,我的 linq 查询出错
问题是我现在在我的项目中尝试做的事情我得到了同样的错误(我猜 linq 仍然试图做错误更改)
我该如何清理待处理的更改或以其他方式处理该问题?
谢谢!
您需要将它们从“队列”中删除。
最简单的就是 call GetChanges,然后反过来做所有的动作。例如,插入变为删除等。
GetChanges
这是我编写的适用于简单情况的扩展方法(根据需要进行修改)。