Browse Source

Update demo

pull/9/head
sunkaixuna 3 years ago
parent
commit
d59b99e76a
  1. 2
      Src/Asp.Net/PgSqlTest/Demo/Demo0_SqlSugarClient.cs
  2. 8
      Src/Asp.Net/SqlServerTest/Demo/Demo0_SqlSugarClient.cs

2
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

8
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<Order>().ExecuteCommand();
await db.Deleteable<Order>().ExecuteCommandAsync();
Console.WriteLine("---Delete all " + db.CurrentConnectionConfig.DbType);
Console.WriteLine(db.Queryable<Order>().Count());
db.ChangeDatabase("2");//use db2
db.Deleteable<Order>().ExecuteCommand();
await db.Deleteable<Order>().ExecuteCommandAsync();
Console.WriteLine("---Delete all " + db.CurrentConnectionConfig.DbType);
Console.WriteLine(db.Queryable<Order>().Count());
throw new Exception("");
});
result2.Wait();
if (result.IsSuccess == false)
if (result2.Result.IsSuccess == false)
{
Console.WriteLine("---Roll back");
db.ChangeDatabase("1");//use sqlserver

Loading…
Cancel
Save