From a6cf3ea0ebef85092ecfe6fb15b7907fa2cb06e7 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Tue, 7 Nov 2017 15:23:41 +0800 Subject: [PATCH] Update Sqlite --- .../SqlBuilder/SqliteExpressionContext.cs | 7 +++++++ .../SqliteTest/DataBase/SqlSugar4xTest.sqlite | Bin 475136 -> 475136 bytes Src/Asp.Net/SqliteTest/Demos/1_Query.cs | 1 + 3 files changed, 8 insertions(+) diff --git a/Src/Asp.Net/SqlSugar/Realization/Sqlite/SqlBuilder/SqliteExpressionContext.cs b/Src/Asp.Net/SqlSugar/Realization/Sqlite/SqlBuilder/SqliteExpressionContext.cs index a925e1deb..96a498f97 100644 --- a/Src/Asp.Net/SqlSugar/Realization/Sqlite/SqlBuilder/SqliteExpressionContext.cs +++ b/Src/Asp.Net/SqlSugar/Realization/Sqlite/SqlBuilder/SqliteExpressionContext.cs @@ -196,5 +196,12 @@ namespace SqlSugar { return string.Join("||", strings).Replace("+",""); } + + public override string IsNull(MethodCallExpressionModel model) + { + var parameter = model.Args[0]; + var parameter1 = model.Args[1]; + return string.Format("IFNULL({0},{1})", parameter.MemberName, parameter1.MemberName); + } } } diff --git a/Src/Asp.Net/SqliteTest/DataBase/SqlSugar4xTest.sqlite b/Src/Asp.Net/SqliteTest/DataBase/SqlSugar4xTest.sqlite index ce9c5bd159234f611eb401d5aff8d70a366edb39..7918b65fafb1637600ca8485ba2bbe6ee95d8c8f 100644 GIT binary patch delta 262 zcmZo@kZov?ogmHlVxo*QaaLk-HWqoH-e5d>gYfC)WdH&JhRy5>KJkoVlSArN zb$`5qCZCf delta 199 zcmZo@kZov?ogmG4Z=#Gd_Ib+3>GQXbvQtbmk3_mc2U3c>M=B9lYv zRdo#&3{9;}46KZe^ehYw%ndD!j0_CTbqx)54KSr9$JhC6{#3teKI4?>bLAP67z5iB Z7~2$>+7y`E6j<66SlblXmMO3+004@OHH!cM diff --git a/Src/Asp.Net/SqliteTest/Demos/1_Query.cs b/Src/Asp.Net/SqliteTest/Demos/1_Query.cs index f756f1f81..d29ef983c 100644 --- a/Src/Asp.Net/SqliteTest/Demos/1_Query.cs +++ b/Src/Asp.Net/SqliteTest/Demos/1_Query.cs @@ -281,6 +281,7 @@ namespace OrmTest.Demo { var db = GetInstance(); var t1 = db.Queryable().Where(it => SqlFunc.ToLower(it.Name) == SqlFunc.ToLower("JACK")).ToList(); + var t2 = db.Queryable().Where(it => SqlFunc.IsNull(it.Name, "nullvalue") == "nullvalue").ToList(); //SELECT [Id],[SchoolId],[Name],[CreateTime] FROM [Student] WHERE ((LOWER([Name])) = (LOWER(@MethodConst0)) ) /***More Functions***/