mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-24 07:22:57 +08:00
Add unit test
This commit is contained in:
parent
45d5528a0e
commit
31592cd24d
@ -109,6 +109,7 @@
|
|||||||
<Compile Include="UnitTest\Unitadf1131.cs" />
|
<Compile Include="UnitTest\Unitadf1131.cs" />
|
||||||
<Compile Include="UnitTest\Unitadfa1231.cs" />
|
<Compile Include="UnitTest\Unitadfa1231.cs" />
|
||||||
<Compile Include="UnitTest\UnitFilterasdfas.cs" />
|
<Compile Include="UnitTest\UnitFilterasdfas.cs" />
|
||||||
|
<Compile Include="UnitTest\UnitFilterUpdate.cs" />
|
||||||
<Compile Include="UnitTest\UnitManyToMany4.cs" />
|
<Compile Include="UnitTest\UnitManyToMany4.cs" />
|
||||||
<Compile Include="UnitTest\UnitManyToMany3.cs" />
|
<Compile Include="UnitTest\UnitManyToMany3.cs" />
|
||||||
<Compile Include="UnitTest\UnitSqlFunc.cs" />
|
<Compile Include="UnitTest\UnitSqlFunc.cs" />
|
||||||
|
@ -31,6 +31,7 @@ namespace OrmTest
|
|||||||
}
|
}
|
||||||
public static void Init()
|
public static void Init()
|
||||||
{
|
{
|
||||||
|
UnitFilterUpdate.Init();
|
||||||
Unitadf1131.Init();
|
Unitadf1131.Init();
|
||||||
UEnum2.Init();
|
UEnum2.Init();
|
||||||
UnitManyToMany4.Init();
|
UnitManyToMany4.Init();
|
||||||
|
29
Src/Asp.Net/SqlServerTest/UnitTest/UnitFilterUpdate.cs
Normal file
29
Src/Asp.Net/SqlServerTest/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().ExecuteCommand();//不支持全局设置需要手动处理
|
||||||
|
|
||||||
|
db.QueryFilter.Clear();
|
||||||
|
|
||||||
|
db.Updateable(updateObj)
|
||||||
|
.PageSize(1)//需要一条一条更新才能用过滤器
|
||||||
|
.EnableQueryFilter().ExecuteCommand();//不支持全局设置需要手动处理
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user