From d59b99e76ae699af1dfc5c26644cedda9dd34405 Mon Sep 17 00:00:00 2001 From: sunkaixuna <610262374@qq.com> Date: Wed, 3 Nov 2021 15:33:39 +0800 Subject: [PATCH] Update demo --- Src/Asp.Net/PgSqlTest/Demo/Demo0_SqlSugarClient.cs | 2 +- Src/Asp.Net/SqlServerTest/Demo/Demo0_SqlSugarClient.cs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Src/Asp.Net/PgSqlTest/Demo/Demo0_SqlSugarClient.cs b/Src/Asp.Net/PgSqlTest/Demo/Demo0_SqlSugarClient.cs index 0397faad0..b102a098c 100644 --- a/Src/Asp.Net/PgSqlTest/Demo/Demo0_SqlSugarClient.cs +++ b/Src/Asp.Net/PgSqlTest/Demo/Demo0_SqlSugarClient.cs @@ -324,7 +324,7 @@ namespace OrmTest }); result2.Wait(); - if (result.IsSuccess == false) + if (result2.Result.IsSuccess == false) { Console.WriteLine("---Roll back"); db.ChangeDatabase("1");//use sqlserver diff --git a/Src/Asp.Net/SqlServerTest/Demo/Demo0_SqlSugarClient.cs b/Src/Asp.Net/SqlServerTest/Demo/Demo0_SqlSugarClient.cs index 8c3279c03..ea6e2537d 100644 --- a/Src/Asp.Net/SqlServerTest/Demo/Demo0_SqlSugarClient.cs +++ b/Src/Asp.Net/SqlServerTest/Demo/Demo0_SqlSugarClient.cs @@ -308,23 +308,23 @@ namespace OrmTest // Example 3 Console.WriteLine("Example 3"); - var result2 = db.UseTranAsync(() => + var result2 = db.UseTranAsync(async () => { db.ChangeDatabase("1");//use db1 - db.Deleteable().ExecuteCommand(); + await db.Deleteable().ExecuteCommandAsync(); Console.WriteLine("---Delete all " + db.CurrentConnectionConfig.DbType); Console.WriteLine(db.Queryable().Count()); db.ChangeDatabase("2");//use db2 - db.Deleteable().ExecuteCommand(); + await db.Deleteable().ExecuteCommandAsync(); Console.WriteLine("---Delete all " + db.CurrentConnectionConfig.DbType); Console.WriteLine(db.Queryable().Count()); throw new Exception(""); }); result2.Wait(); - if (result.IsSuccess == false) + if (result2.Result.IsSuccess == false) { Console.WriteLine("---Roll back"); db.ChangeDatabase("1");//use sqlserver