Reputation: 85835
I found this article about how to insert, update and delete using linq pad but it mentions nothing about rolling back anything.
Is it possible to rollback in linqpad?
Upvotes: 11
Views: 3086
Reputation: 27353
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.
}
Upvotes: 15