diff --git a/Src/Asp.Net/SqlServerTest/Demo/Demo2_Updateable.cs b/Src/Asp.Net/SqlServerTest/Demo/Demo2_Updateable.cs index a4caa3045..bcd0fe9dc 100644 --- a/Src/Asp.Net/SqlServerTest/Demo/Demo2_Updateable.cs +++ b/Src/Asp.Net/SqlServerTest/Demo/Demo2_Updateable.cs @@ -100,6 +100,12 @@ namespace OrmTest //Where Sql db.Updateable(updateObj).Where("id=@x", new { x = "1" }).ExecuteCommand(); + + var levelCode = "123213123131321"; + db.Updateable(a => a.Name == "a") + .Where(a => SqlFunc.StartsWith(a.Name, levelCode)) + .AddQueue(); + db.SaveQueues(); Console.WriteLine("#### Updateable End ####"); } diff --git a/Src/Asp.Net/SqlSugar/Utilities/UtilMethods.cs b/Src/Asp.Net/SqlSugar/Utilities/UtilMethods.cs index ce7c38be5..333589ea9 100644 --- a/Src/Asp.Net/SqlSugar/Utilities/UtilMethods.cs +++ b/Src/Asp.Net/SqlSugar/Utilities/UtilMethods.cs @@ -93,6 +93,8 @@ namespace SqlSugar itemSql = Regex.Replace(itemSql, string.Format(@"{0}\,", "\\" + itemParameter.ParameterName), newName + ",", RegexOptions.IgnoreCase); itemSql = Regex.Replace(itemSql, string.Format(@"{0}$", "\\" + itemParameter.ParameterName), newName, RegexOptions.IgnoreCase); itemSql = Regex.Replace(itemSql, string.Format(@"\+{0}\+", "\\" + itemParameter.ParameterName), "+" + newName + "+", RegexOptions.IgnoreCase); + itemSql = Regex.Replace(itemSql, string.Format(@"\+{0} ", "\\" + itemParameter.ParameterName), "+" + newName +" ", RegexOptions.IgnoreCase); + itemSql = Regex.Replace(itemSql, string.Format(@" {0}\+", "\\" + itemParameter.ParameterName)," "+ newName + "+", RegexOptions.IgnoreCase); itemSql = Regex.Replace(itemSql, string.Format(@"\|\|{0}\|\|", "\\" + itemParameter.ParameterName), "+" + newName + "+", RegexOptions.IgnoreCase); return itemSql; }