Closed SherryShi0108 closed 2 years ago
是写错了OK我会改掉
更新过了,以前异步事务用例也是错的
var result2 = db.UseTranAsync(async () =>
{
db.ChangeDatabase("1");//use db1
await db.Deleteable<Order>().ExecuteCommandAsync();
Console.WriteLine("---Delete all " + db.CurrentConnectionConfig.DbType);
Console.WriteLine(db.Queryable<Order>().Count());
db.ChangeDatabase("2");//use db2
await db.Deleteable<Order>().ExecuteCommandAsync();
Console.WriteLine("---Delete all " + db.CurrentConnectionConfig.DbType);
Console.WriteLine(db.Queryable<Order>().Count());
throw new Exception("");
});
https://github.com/donet5/SqlSugar/blob/094c75ed2f534e5e82727fda725743b0672555bd/Src/Asp.Net/PgSqlTest/Demo/Demo0_SqlSugarClient.cs#L327
Maybe:
if (result2.Result.IsSuccess == false)
看了下好像所有Demo中的事务用法这里都写错了~