mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-27 03:09:34 +08:00
Debugging has perfect functions
This commit is contained in:
@@ -7,7 +7,7 @@ using System.Text;
|
||||
|
||||
namespace OrmTest.Demo
|
||||
{
|
||||
public class IInsertOrUpdate : DemoBase
|
||||
public class InsertOrUpdate : DemoBase
|
||||
{
|
||||
public static void Init()
|
||||
{
|
||||
51
Src/Asp.Net/SqlServerTest/Demos/J_Debugger.cs
Normal file
51
Src/Asp.Net/SqlServerTest/Demos/J_Debugger.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using OrmTest.Demo;
|
||||
using OrmTest.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OrmTest.Demo
|
||||
{
|
||||
public class Debugger : DemoBase
|
||||
{
|
||||
public static void Init()
|
||||
{
|
||||
var db = GetInstance();
|
||||
db.CurrentConnectionConfig.Debugger = new SqlSugar.SugarDebugger() { EnableThreadSecurityValidation = true };
|
||||
|
||||
db.Queryable<Student>().ToList();
|
||||
db.Queryable<Student>().ToListAsync().Wait();
|
||||
db.Insertable<Student>(new Student() { Name = "a" }).ExecuteCommandAsync();
|
||||
db.Updateable<Student>(new Student() { Name = "a" }).ExecuteCommandAsync();
|
||||
db.Deleteable<Student>(1111).ExecuteCommandAsync();
|
||||
try
|
||||
{
|
||||
var task = new Task(() =>
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
//error
|
||||
db.Queryable<Student>().ToList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
task.Start();
|
||||
task.Wait();
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -60,7 +60,8 @@ namespace OrmTest
|
||||
Demo.ExtEntity.Init();
|
||||
Demo.VersionValidation.Init();
|
||||
Demo.Delete.Init();
|
||||
Demo.IInsertOrUpdate.Init();
|
||||
Demo.InsertOrUpdate.Init();
|
||||
Demo.Debugger.Init();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,8 @@
|
||||
<Compile Include="BugTest\BugModels\tLogonHistoryModel.cs" />
|
||||
<Compile Include="BugTest\BugModels\VipAccountsModel.cs" />
|
||||
<Compile Include="BugTest\BugModels\VipBenefitsModel.cs" />
|
||||
<Compile Include="Demos\IInsertOrUpdate.cs" />
|
||||
<Compile Include="Demos\I_InsertOrUpdate.cs" />
|
||||
<Compile Include="Demos\J_Debugger.cs" />
|
||||
<Compile Include="Models\Brand.cs" />
|
||||
<Compile Include="BugTest\Bug1.cs" />
|
||||
<Compile Include="Models\VendorAndBrand.cs" />
|
||||
|
||||
Reference in New Issue
Block a user