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