我发现this article关于如何使用linq pad插入,更新和删除它,但它没有提到回滚任何内容。
是否可以在linqpad中回滚?
答案 0 :(得分:8)
是。你可以这样做:
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.
}