From 9116da50a1a80f30a077fc7efbf34abbfe8778cd Mon Sep 17 00:00:00 2001 From: SUNKAIXUAN <610262374@qq.com> Date: Mon, 29 Mar 2021 16:57:56 +0800 Subject: [PATCH] Update demo --- Src/Asp.Net/SqlServerTest/UnitTest/UFilter.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/UFilter.cs b/Src/Asp.Net/SqlServerTest/UnitTest/UFilter.cs index af789f914..8f4f826b4 100644 --- a/Src/Asp.Net/SqlServerTest/UnitTest/UFilter.cs +++ b/Src/Asp.Net/SqlServerTest/UnitTest/UFilter.cs @@ -76,6 +76,20 @@ namespace OrmTest .Where(o=>o.name=="") .Select("o.*").ToSql(); UValidate.Check(s13.Key, "SELECT o.* FROM [UnitFilterClass2] o Left JOIN [UnitFilterClass1] i ON ( [o].[id] = [i].[id] ) WHERE ( [o].[name] = @name0 ) AND ( [i].[id] > @id1 ) AND ( [o].[id] = @id2 )", "UnitFilter"); + + db.QueryFilter.Clear(); + db.QueryFilter.Add(new SqlFilterItem() + { + + FilterValue = it => + { + //Writable logic + return new SqlFilterResult() { Sql = " id=@id ", Parameters= new { id=1} }; + }, + IsJoinQuery = false //单表查询生效 + }); + var s14 = db.Queryable().ToPageListAsync(1,2,3); + s14.Wait(); } public class UnitFilterClass1 {