title: How to use Transaction in Entity Framework?
body: <p>How to use transactions in Entity Framework? I read some links on Stackoverflow : <a href="https://stackoverflow.com/questions/815586/entity-framework-using-transactions-or-savechangesfalse-and-acceptallchanges">Using Transactions or SaveChanges(false) and AcceptAllChanges()?</a></p>
  
  <p>BUT; i have 3 table so i have 3 entities: </p>
  
  <pre><code>CREATE TABLE Personel 
  (PersonelID integer PRIMARY KEY identity not null, 
  Ad varchar(30), 
  Soyad varchar(30),
  Meslek varchar(100),
  DogumTarihi datetime,
  DogumYeri nvarchar(100),
  PirimToplamı float);
  
  Go
  
  create TABLE Prim
  (PrimID integer PRIMARY KEY identity not null,
  PersonelID integer Foreign KEY references Personel(PersonelID),
  SatisTutari int,
  Prim float,
  SatisTarihi Datetime);
  
  Go
  
  CREATE TABLE Finans 
  (ID integer PRIMARY KEY identity not null, 
  Tutar float);
  </code></pre>
  
  <p>Personel, Prim, Finans my tables. If you look Prim table you can see Prim value float value if I write a textbox not float value my transaction must run.</p>
  
  <pre><code>using (TestEntities testCtx = new TestEntities())
  {
      using (TransactionScope scope = new TransactionScope())
      {
         // do something...
         testCtx.Personel.SaveChanges();
         // do something...
         testCtx.Prim.SaveChanges();
         // do something...
         testCtx.Finans.SaveChanges();
         scope.Complete();
         success = true;
      }
  }
  </code></pre>
  
  <p>How can I do that?</p>