diff --git a/Src/Asp.Net/OracleTest/Demos/1_Query.cs b/Src/Asp.Net/OracleTest/Demos/1_Query.cs index 12de1fbe5..5a47ca7cc 100644 --- a/Src/Asp.Net/OracleTest/Demos/1_Query.cs +++ b/Src/Asp.Net/OracleTest/Demos/1_Query.cs @@ -336,6 +336,18 @@ namespace OrmTest.Demo var list8 = db.Queryable((st, sc, sc2) => st.SchoolId == sc.Id && sc.Id == sc2.Id) .OrderBy(st=>st.Id) .Select((st, sc, sc2) => new { st.Name, st.Id, schoolName = sc.Name, schoolName2 = sc2.Name }).ToPageList(1, 2); + + var q1 = db.Queryable().Select(it => new Student() + { + Id=it.Id, + Name="a" + }); + var q2 = db.Queryable().Select(it => new Student() + { + Id = it.Id, + Name = "b" + }); + var unionAllList=db.Union(q1, q2).ToList(); } public static void Funs() { diff --git a/Src/Asp.Net/SqlServerTest/Demos/1_Query.cs b/Src/Asp.Net/SqlServerTest/Demos/1_Query.cs index 0ccc7dac8..93c89c74c 100644 --- a/Src/Asp.Net/SqlServerTest/Demos/1_Query.cs +++ b/Src/Asp.Net/SqlServerTest/Demos/1_Query.cs @@ -539,6 +539,18 @@ namespace OrmTest.Demo id=st1.Id, name=st2.Name }).ToList(); + + var q1 = db.Queryable().Select(it => new Student() + { + Id = it.Id, + Name = "a" + }); + var q2 = db.Queryable().Select(it => new Student() + { + Id = it.Id, + Name = "b" + }); + var unionAllList = db.Union(q1, q2).ToList(); } public static void Funs() { diff --git a/Src/Asp.Net/SqlSugar/Utilities/UtilMethods.cs b/Src/Asp.Net/SqlSugar/Utilities/UtilMethods.cs index dc20c7321..031ccfa85 100644 --- a/Src/Asp.Net/SqlSugar/Utilities/UtilMethods.cs +++ b/Src/Asp.Net/SqlSugar/Utilities/UtilMethods.cs @@ -78,7 +78,7 @@ namespace SqlSugar //Compatible with.NET CORE parameters case var name = parameter.ParameterName; string newName = name +append+ addIndex; - appendSql = appendSql.Replace(name, newName); + appendSql =Regex.Replace(appendSql,name,newName,RegexOptions.IgnoreCase); parameter.ParameterName = newName; } }