From 5731c3002f2631a2e85555f2e3f32d7d4433cff5 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Fri, 11 Aug 2017 12:59:05 +0800 Subject: [PATCH] Update Demo --- Src/Asp.Net/SqlServerTest/Demos/7_Filter.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Src/Asp.Net/SqlServerTest/Demos/7_Filter.cs b/Src/Asp.Net/SqlServerTest/Demos/7_Filter.cs index 273f6f814..03cf32f76 100644 --- a/Src/Asp.Net/SqlServerTest/Demos/7_Filter.cs +++ b/Src/Asp.Net/SqlServerTest/Demos/7_Filter.cs @@ -35,6 +35,8 @@ namespace OrmTest.Demo var sql4 = db.Queryable().Filter(key,true).ToSql(); //SELECT [ID],[SchoolId],[Name],[CreateTime] FROM [STudent] WHERE WHERE id>@id + var sql5 = db.Ado.GetInt("select {0}"); + //select 1 } public static SqlSugarClient GetInstance1() @@ -65,6 +67,16 @@ namespace OrmTest.Demo }, IsJoinQuery = false }); + + //Processing prior to execution of SQL + db.Ado.ProcessingEventStartingSQL = (sql, par) => + { + if (sql.Contains("{0}")) + { + sql = string.Format(sql, "1"); + } + return new KeyValuePair(sql,par); + }; return db; } }