update

2881099
2020-12-04 00:54:22 +08:00
parent 82c2de2182
commit d1055b6236

@@ -120,6 +120,8 @@ using (var uow = fsql.CreateUnitOfWork())
uow.Orm.Insert(new Products()).ExecuteAffrows(); //正常
fsql.Insert(new Products()).ExecuteAffrows(); //错误,没有传事务
fsql.Insert(new Products()).WithTransaction(uow.GetOrBeginTransaction()).ExecuteAffrows(); //正常
uow.Commit();
}
@@ -131,6 +133,8 @@ using (var ctx = fsql.CreateDbContext())
ctx.Orm.Insert(new Products()).ExecuteAffrows(); //正常
fsql.Insert(new Products()).ExecuteAffrows(); //错误,没有传事务
fsql.Insert(new Products()).WithTransaction(ctx.UnitOfWork.GetOrBeginTransaction()).ExecuteAffrows(); //正常
ctx.SaveChanges();
}