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.
我找到了这篇关于如何使用 linq pad 插入、更新和删除的文章,但它没有提到任何关于回滚的内容。
是否可以在 linqpad 中回滚?
是的。你可以做:
using (TransactionScope scope = new TransactionScope()) { // Put the operations that you want to protect in a transaction here. if (you_want_to_commit) { scope.Complete(); } // Otherwise, it'll roll back when you exit the using block. }