diff --git a/OrmTest/ExpressionTest/Where.cs b/OrmTest/ExpressionTest/Where.cs index 23422eba8..128a11b88 100644 --- a/OrmTest/ExpressionTest/Where.cs +++ b/OrmTest/ExpressionTest/Where.cs @@ -28,6 +28,7 @@ namespace OrmTest.ExpressionTest whereSingle5(); whereSingle6(); WhereMultiple1(); + WhereMultiple2(); } base.End("Where Test"); } @@ -42,6 +43,22 @@ namespace OrmTest.ExpressionTest new SugarParameter("@Id0",1) }, "WhereMultiple1"); } + private void WhereMultiple2() + { + string name = "a"; + WhereConst.name = "a1"; + Expression> exp = it => (it.Id > 1 && it.Name != name || it.Id == 1) || it.Name == WhereConst.name; + ExpressionContext expContext = new ExpressionContext(exp, ResolveExpressType.WhereMultiple); + expContext.Resolve(); + var value = expContext.Result.GetString(); + var pars = expContext.Parameters; + base.Check(value, pars, " (((( it.Id > @Id0 ) AND ( it.Name <> @Name1 )) OR ( it.Id = @Id2 )) OR ( it.Name = @Name3 ))", new List() { + new SugarParameter("@Id0",1), + new SugarParameter("@Name1","a"), + new SugarParameter("@Id2",1), + new SugarParameter("@Name3","a1") + }, "WhereMultiple2"); + } private void whereSingle1() { Expression> exp = it => it.Id > 1; diff --git a/OrmTest/Program.cs b/OrmTest/Program.cs index f114f9f5f..7c98f4796 100644 --- a/OrmTest/Program.cs +++ b/OrmTest/Program.cs @@ -17,7 +17,7 @@ namespace OrmTest static void Main(string[] args) { //Expression To Sql Unit Test - int eachCount = 1; + int eachCount = 1000; new OrmTest.ExpressionTest.Select(eachCount).Init(); new OrmTest.ExpressionTest.Field(eachCount).Init(); new OrmTest.ExpressionTest.Where(eachCount).Init(); diff --git a/OrmTest/bin/Debug/OrmTest.exe b/OrmTest/bin/Debug/OrmTest.exe index fb1f17861..b9f4bace3 100644 Binary files a/OrmTest/bin/Debug/OrmTest.exe and b/OrmTest/bin/Debug/OrmTest.exe differ diff --git a/OrmTest/bin/Debug/OrmTest.pdb b/OrmTest/bin/Debug/OrmTest.pdb index 47784992b..8cea0eb05 100644 Binary files a/OrmTest/bin/Debug/OrmTest.pdb and b/OrmTest/bin/Debug/OrmTest.pdb differ diff --git a/OrmTest/bin/Debug/SqlSugar.dll b/OrmTest/bin/Debug/SqlSugar.dll index d366d2f1d..d0def311a 100644 Binary files a/OrmTest/bin/Debug/SqlSugar.dll and b/OrmTest/bin/Debug/SqlSugar.dll differ diff --git a/OrmTest/bin/Debug/SqlSugar.pdb b/OrmTest/bin/Debug/SqlSugar.pdb index 562a1483c..28fd83acc 100644 Binary files a/OrmTest/bin/Debug/SqlSugar.pdb and b/OrmTest/bin/Debug/SqlSugar.pdb differ