mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-05 17:37:58 +08:00
Add unit test
This commit is contained in:
parent
649990cde8
commit
1105e25eff
@ -96,6 +96,7 @@
|
|||||||
<Compile Include="UnitTest\UInsert3.cs" />
|
<Compile Include="UnitTest\UInsert3.cs" />
|
||||||
<Compile Include="UnitTest\Unit01.cs" />
|
<Compile Include="UnitTest\Unit01.cs" />
|
||||||
<Compile Include="UnitTest\UnitByteArray.cs" />
|
<Compile Include="UnitTest\UnitByteArray.cs" />
|
||||||
|
<Compile Include="UnitTest\UnitFilterUpdate.cs" />
|
||||||
<Compile Include="UnitTest\UnitNavInsertadfa1.cs" />
|
<Compile Include="UnitTest\UnitNavInsertadfa1.cs" />
|
||||||
<Compile Include="UnitTest\UnitNavInsertIssue.cs" />
|
<Compile Include="UnitTest\UnitNavInsertIssue.cs" />
|
||||||
<Compile Include="UnitTest\UnitInsertNavN.cs" />
|
<Compile Include="UnitTest\UnitInsertNavN.cs" />
|
||||||
|
@ -31,6 +31,7 @@ namespace OrmTest
|
|||||||
}
|
}
|
||||||
public static void Init()
|
public static void Init()
|
||||||
{
|
{
|
||||||
|
UnitFilterUpdate.Init();
|
||||||
USelectDTO.Init();
|
USelectDTO.Init();
|
||||||
UnitNavOneToManyDTO.Init();
|
UnitNavOneToManyDTO.Init();
|
||||||
Unitadfaafsd.Init();
|
Unitadfaafsd.Init();
|
||||||
|
29
Src/Asp.Net/SqliteTest/UnitTest/UnitFilterUpdate.cs
Normal file
29
Src/Asp.Net/SqliteTest/UnitTest/UnitFilterUpdate.cs
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Runtime.Remoting.Messaging;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace OrmTest
|
||||||
|
{
|
||||||
|
internal class UnitFilterUpdate
|
||||||
|
{
|
||||||
|
public static void Init()
|
||||||
|
{
|
||||||
|
var db = NewUnitTest.Db;
|
||||||
|
var updateObj = new Order() { Id = 1, Name = "a", CustomId = 1, CreateTime = DateTime.Now };
|
||||||
|
db.QueryFilter.AddTableFilter<Order>(x => x.Name == "a");
|
||||||
|
|
||||||
|
db.Updateable(updateObj)
|
||||||
|
.PageSize(1)//需要一条一条更新才能用过滤器
|
||||||
|
.EnableQueryFilter().ExecuteCommandAsync().GetAwaiter().GetResult();//不支持全局设置需要手动处理
|
||||||
|
|
||||||
|
db.QueryFilter.Clear();
|
||||||
|
|
||||||
|
db.Updateable(updateObj)
|
||||||
|
.PageSize(1)//需要一条一条更新才能用过滤器
|
||||||
|
.EnableQueryFilter().ExecuteCommandAsync().GetAwaiter().GetResult();//不支持全局设置需要手动处理
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user