mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 01:58:13 +08:00
-
This commit is contained in:
@@ -28,6 +28,7 @@ namespace OrmTest.UnitTest
|
||||
whereSingle5();
|
||||
whereSingle6();
|
||||
whereSingle7(new Student() { Id = 1 });
|
||||
//whereSingle8(new Student() { Id = 1 });
|
||||
WhereMultiple1();
|
||||
WhereMultiple2();
|
||||
|
||||
@@ -150,6 +151,18 @@ namespace OrmTest.UnitTest
|
||||
new SugarParameter("@Id0",1)
|
||||
}, "whereSingle7");
|
||||
}
|
||||
|
||||
private void whereSingle8(Student st)
|
||||
{
|
||||
Expression<Func<Student, bool>> exp = it => it.Name == null;
|
||||
ExpressionContext expContext = new ExpressionContext();
|
||||
expContext.Resolve(exp, ResolveExpressType.WhereSingle);
|
||||
var value = expContext.Result.GetString();
|
||||
var pars = expContext.Parameters;
|
||||
base.Check(value, pars, "( [Name] is @Id0 )", new List<SugarParameter>() {
|
||||
new SugarParameter("@Id0",1)
|
||||
}, "whereSingle8");
|
||||
}
|
||||
}
|
||||
|
||||
public class WhereConst
|
||||
|
@@ -33,7 +33,8 @@ namespace SqlSugar
|
||||
var lsrb = !leftIsBinary && rightBinary;
|
||||
var lbrb = rightBinary && leftIsBinary;
|
||||
var lsbs = !leftIsBinary && !rightBinary;
|
||||
if (!base.Context.Result.Contains(ExpressionConst.Format0))
|
||||
var isBegin = !base.Context.Result.Contains(ExpressionConst.Format0);
|
||||
if (isBegin)
|
||||
{
|
||||
base.Context.Result.Append(ExpressionConst.Format3);
|
||||
base.Context.Result.Append(ExpressionConst.Format0);
|
||||
@@ -46,11 +47,14 @@ namespace SqlSugar
|
||||
base.Expression = leftExpression;
|
||||
base.IsLeft = true;
|
||||
base.Start();
|
||||
base.Context.Result.Replace(ExpressionConst.Format1+parameter.Index,operatorValue);
|
||||
base.IsLeft = false;
|
||||
base.Expression = rightExpression;
|
||||
base.Start();
|
||||
base.IsLeft = null;
|
||||
base.Context.Result.Replace(ExpressionConst.Format1 + parameter.Index, operatorValue);
|
||||
if (lsbs) {
|
||||
|
||||
}
|
||||
base.Context.Result.Append(ExpressionConst.Format4);
|
||||
if (parameter.BaseExpression is BinaryExpression && parameter.IsLeft == true)
|
||||
{
|
||||
|
Reference in New Issue
Block a user