title: EF 4.1 Code First - wrap multiple calls to SaveChanges in a transaction
body: <p>For reasons described <a href="https://stackoverflow.com/questions/5936880/ef-code-fist-4-1-how-to-configure-one-to-many-relationship-with-default/5940818#5940818">here</a> I need to make multiple calls to SaveChanges.  I would like both of these calls to be wrapped up in a transaction (so that if the second call fails, the first call will roll back).  For example:</p>
  
  <pre><code>AccountsContext context = new AccountsContext(connectionString);
  
  CountryNotes notes = new CountryNotes();
  notes.Notes = "First save";
  context.SaveChanges();
  
  notes.Notes = "Second save";
  context.SaveChanges();
  </code></pre>
  
  <p>How do I put the above two calls to SaveChanges in a single transaction?</p>
  
  <p>Thanks,</p>
  
  <p>Paul.</p>