Skip to content

Instantly share code, notes, and snippets.

@FernandoVezzali
Created August 12, 2013 10:33
Show Gist options
  • Save FernandoVezzali/6209785 to your computer and use it in GitHub Desktop.
Save FernandoVezzali/6209785 to your computer and use it in GitHub Desktop.
TransactionScope Entity Framework 5
using(var scope = new TransactionScope(TransactionScopeOption.Required,
new TransactionOptions { IsolationLevel = IsolationLevel.ReadCommitted }))
{
// Do something
context.SaveChanges();
// Do something else
context.SaveChanges();
scope.Complete();
}
@FernandoVezzali
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment