C# 事务

2019-10-08  本文已影响0人  飞天猪Pony
 using (var db = new REF_ParkAzureEntities())
{
     using (var trans = db.Database.BeginTransaction())
     {
             try
             {
                   trans.Commit();
             }
             catch (Exception ex)
             {
                   trans.Rollback();
                   throw;
              }
      }
}
上一篇下一篇

猜你喜欢

热点阅读