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.
我有一个 wpf 窗口,其中网格绑定到 entityCollection。在这里,我将记录添加/删除到网格,然后单击取消按钮。如何恢复对 entitycollection 所做的更改。
EF 不要求您在将任何内容保存到数据库之前调用 SavChanges() 吗?您不需要添加取消按钮,而是添加保存按钮。
如果您的对象状态已更改,您将无法使用Overwrite选项从服务器重新加载集合。
在更好的情况下,您可以使用 Memento 模式。