Transaction Rollback C#
using (var dbContextTransaction = Model3.Database.BeginTransaction())
{
try
{
Model3.Database.ExecuteSqlCommand(t);
dbContextTransaction.Commit();
}
catch (Exception ex)
{
dbContextTransaction.Rollback();
}
}