Update unit test

This commit is contained in:
sunkaixuna 2021-07-31 19:46:56 +08:00
parent b7576ed2b9
commit cb87c9b1e0
4 changed files with 33 additions and 1 deletions

View File

@ -80,7 +80,8 @@
<Compile Include="Models\OrderItem.cs" />
<Compile Include="Demo\Demo0_SqlSugarClient.cs" />
<Compile Include="Models\ViewOrder.cs" />
<Compile Include="UnitTest\Test01.cs" />
<Compile Include="UnitTest\UAopTest.cs" />
<Compile Include="UnitTest\UTest01.cs" />
<Compile Include="UnitTest\UEnum.cs" />
<Compile Include="UnitTest\UFilter.cs" />
<Compile Include="UnitTest\UInsert2.cs" />

View File

@ -31,6 +31,7 @@ namespace OrmTest
}
public static void Init()
{
Filter();
Insert();
Insert2();
@ -44,6 +45,7 @@ namespace OrmTest
Queryable();
Queryable2();
QueryableAsync();
AopTest();
//Thread();
//Thread2();
//Thread3();

View File

@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OrmTest
{
public partial class NewUnitTest
{
public static void AopTest()
{
var db = Db;
db.CurrentConnectionConfig.ConfigureExternalServices = new SqlSugar.ConfigureExternalServices()
{
EntityNameService = (t, e) => {
e.DbTableName = "dbo." + e.DbTableName;
}
};
db.Queryable<Order>().Select(it=> new {
x=SqlSugar.SqlFunc.Subqueryable<Order>().Select(s=>s.Id)
}).ToList();
db.CurrentConnectionConfig.ConfigureExternalServices = new SqlSugar.ConfigureExternalServices();
}
}
}