From 27d8d3cee5de062ac5f8bf8da9a0de13f3f9d6c8 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Sun, 16 Jul 2023 16:05:45 +0800 Subject: [PATCH] Add SqlFunc.SplitIn(+3) --- .../SqlSugar/ExpressionsToSql/DbMethods/DefaultDbMethod.cs | 6 ++++++ Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/SqlFunc.cs | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/DefaultDbMethod.cs b/Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/DefaultDbMethod.cs index 2d66a29cf..72ae2b34e 100644 --- a/Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/DefaultDbMethod.cs +++ b/Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/DefaultDbMethod.cs @@ -770,6 +770,12 @@ namespace SqlSugar var value1 = MergeString(value, "','"); var value2 = MergeString("','", value); var value3 = MergeString("','", value, "','"); + if (model.Args.Count == 3) + { + value1 = value1.Replace("','", model.Args[2].MemberName+"" ); + value2 = value2.Replace("','", model.Args[2].MemberName + "" ); + value3 = value3.Replace("','", model.Args[2].MemberName + "" ); + } var likeString1 = StartsWith(new MethodCallExpressionModel() { Args = new List() { new MethodCallExpressionArgs(){ IsMember=true, MemberName=fullString }, diff --git a/Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/SqlFunc.cs b/Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/SqlFunc.cs index e05b3ebe4..63a548c21 100644 --- a/Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/SqlFunc.cs +++ b/Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/SqlFunc.cs @@ -344,6 +344,11 @@ namespace SqlSugar throw new NotSupportedException("Can only be used in expressions"); } + public static bool SplitIn(string CommaSegmentationString, string inValue,char splitChar) + { + throw new NotSupportedException("Can only be used in expressions"); + } + public static bool ListAny(List listConstant, Expression> expression) { throw new NotSupportedException("Can only be used in expressions");