From 2c185de4d877c9593a77000df53aa8b69bf4546f Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Sun, 11 Jun 2017 10:12:19 +0800 Subject: [PATCH] Update Filter Demo --- SqlServerTest/Demos/Filter.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/SqlServerTest/Demos/Filter.cs b/SqlServerTest/Demos/Filter.cs index a06d142fb..273f6f814 100644 --- a/SqlServerTest/Demos/Filter.cs +++ b/SqlServerTest/Demos/Filter.cs @@ -18,15 +18,22 @@ namespace OrmTest.Demo var db = GetInstance1(); var sql = db.Queryable().ToSql(); + //SELECT [ID],[SchoolId],[Name],[CreateTime] FROM [STudent] WHERE isDelete=0 var sql2 = db.Queryable((f, s) => new object[] { JoinType.Left, f.SchoolId == s.Id }).ToSql(); + //SELECT[f].[ID],[f].[SchoolId],[f].[Name],[f].[CreateTime] + //FROM[STudent] f Left JOIN School s ON([f].[SchoolId] = [s].[Id]) WHERE f.isDelete=0 + //Specify name filter var sql3 = db.Queryable().Filter("query1").ToSql(); + //SELECT [ID],[SchoolId],[Name],[CreateTime] FROM [STudent] WHERE WHERE id>@id AND isDelete=0 + //Specify key filter and disabled global filter string key = "query1"; var sql4 = db.Queryable().Filter(key,true).ToSql(); + //SELECT [ID],[SchoolId],[Name],[CreateTime] FROM [STudent] WHERE WHERE id>@id }