var tran = ef.Database.BeginTransaction();
try
{
ef.SaveChanges();
tran.Commit();
}
catch (Exception ex)
{
tran.Rollback();
LogHelper.Error("OrderInfoEntity表保存异常:" + ex.Message);
//throw ex;
}
ef 事务
最新推荐文章于 2024-07-26 12:28:02 发布