How to use transactions with the Entity Framework? -


When you have such a code:

  something = something new (); BlahEntities b = new BlahEntities () b.AddToSomethingSet (some); B.SaveChanges ();  

What extra work does the transaction work?

You can enter your code in the

  field of transactions (Transaction Scope Scope = New Transaction ()) {// Your Code is scope.Complete (); //  to commit. }  

The TransactionScope System.Transactions are located in the namespace, which is located in the assembly of the same name (which you may have to manually add to your project).


Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -