DotNetNext / SqlSugar

.Net aot ORM Fastest ORM Simple Easy VB.NET Sqlite orm Oracle ORM Mysql Orm 虚谷数据库 postgresql ORm SqlServer oRm 达梦 ORM 人大金仓 ORM 神通ORM C# ORM , C# ORM .NET ORM NET5 ORM .NET6 ORM ClickHouse orm QuestDb ,TDengine ORM,OceanBase orm,GaussDB orm ,Tidb orm Object/Relational Mapping
https://www.donet5.com/Home/Doc
MIT License
5.35k stars 1.34k forks source link

Demo异步返回类型引用有误 #969

Closed SherryShi0108 closed 2 years ago

SherryShi0108 commented 2 years ago

https://github.com/donet5/SqlSugar/blob/094c75ed2f534e5e82727fda725743b0672555bd/Src/Asp.Net/PgSqlTest/Demo/Demo0_SqlSugarClient.cs#L327

Maybe:

if (result2.Result.IsSuccess == false)

看了下好像所有Demo中的事务用法这里都写错了~

DotNetNext commented 2 years ago

是写错了OK我会改掉

DotNetNext commented 2 years ago

更新过了,以前异步事务用例也是错的

DotNetNext commented 2 years ago
 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("");

        });