Roll back insert / update / delete in linq panel?

I found this article on how to insert, update, and delete using the linq pad, but it doesn't say anything about rollback.

Is rollback possible in linqpad?

+4
source share
1 answer

Yes. You can do:

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. } 
+6
source

All Articles