How to roll back an transaction in Entity Framework 7?
In the old version, we have
try
{
dataContext.ChangeTracker.DetectChanges();
dataContext.SaveChanges();
}
catch (Exception e)
{
dataContext.Database.CurrentTransaction.Rollback();
Debug.WriteLine(e.Message);
}
Now I use
"EntityFramework.Commands": "7.0.0-rc1-final"
It doesn't have the method.
SaveChanges
have covered transaction failure. If so, why there wasRollback
method invented? – user1108948 May 16 '16 at 14:06