Browse Source

-

pull/2/head
skx 4 years ago
parent
commit
ae0a67f89e
  1. 6
      Src/Asp.Net/SqlServerTest/Demo/Demo2_Updateable.cs
  2. 2
      Src/Asp.Net/SqlSugar/Utilities/UtilMethods.cs

6
Src/Asp.Net/SqlServerTest/Demo/Demo2_Updateable.cs

@ -100,6 +100,12 @@ namespace OrmTest
//Where Sql //Where Sql
db.Updateable(updateObj).Where("id=@x", new { x = "1" }).ExecuteCommand(); db.Updateable(updateObj).Where("id=@x", new { x = "1" }).ExecuteCommand();
var levelCode = "123213123131321";
db.Updateable<Order>(a => a.Name == "a")
.Where(a => SqlFunc.StartsWith(a.Name, levelCode))
.AddQueue();
db.SaveQueues();
Console.WriteLine("#### Updateable End ####"); Console.WriteLine("#### Updateable End ####");
} }

2
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);
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; return itemSql;
} }

Loading…
Cancel
Save