For reasons described here 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:
AccountsContext context = new AccountsContext(connectionString);
CountryNotes notes = new CountryNotes();
notes.Notes = "First save";
context.SaveChanges();
notes.Notes = "Second save";
context.SaveChanges();
How do I put the above two calls to SaveChanges in a single transaction?
Thanks,
Paul.