Debugging has perfect functions

This commit is contained in:
sunkaixuan
2019-01-25 21:45:15 +08:00
parent 0d89bf7caf
commit b3f7fc29d1
10 changed files with 69 additions and 12 deletions

View File

@@ -7,7 +7,7 @@ using System.Text;
namespace OrmTest.Demo
{
public class IInsertOrUpdate : DemoBase
public class InsertOrUpdate : DemoBase
{
public static void Init()
{

View 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
{
}
}
}
}

View File

@@ -60,7 +60,8 @@ namespace OrmTest
Demo.ExtEntity.Init();
Demo.VersionValidation.Init();
Demo.Delete.Init();
Demo.IInsertOrUpdate.Init();
Demo.InsertOrUpdate.Init();
Demo.Debugger.Init();
}
}
}

View File

@@ -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" />