This commit is contained in:
sunkaixuan
2017-01-08 21:05:00 +08:00
parent 3ecf1beaea
commit 1766614f74
14 changed files with 4 additions and 11 deletions

Binary file not shown.

View File

@@ -18,6 +18,7 @@ namespace OrmTest
{ {
string id = "1"; string id = "1";
Expression<Func<Student, bool>> exp = it => it.Name!=id; Expression<Func<Student, bool>> exp = it => it.Name!=id;
// Expression<Func<Student, object>> exp = it => it.Name;
ExpressionContext expContext = new ExpressionContext(exp, ResolveExpressType.Single); ExpressionContext expContext = new ExpressionContext(exp, ResolveExpressType.Single);
// var x = expContext.GetFiledName(); // var x = expContext.GetFiledName();
var xx = expContext.ToSqlString(); var xx = expContext.ToSqlString();

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -9,18 +9,10 @@ namespace SqlSugar
{ {
public LambdaExpressionResolve(ExpressionParameter parameter) : base(parameter) public LambdaExpressionResolve(ExpressionParameter parameter) : base(parameter)
{ {
LambdaExpression lambda =base.Expression as LambdaExpression; LambdaExpression lambda = base.Expression as LambdaExpression;
var expression = lambda.Body; var expression = lambda.Body;
if (expression.NodeType == ExpressionType.MemberAccess) base.Expression = expression;
{ base.Start();
string appendString = "(" +((MemberExpression)expression).Member.Name + "=1)";
base.Context.SqlWhere.Append(appendString);
}
else
{
base.Expression = expression;
base.Start();
}
} }
} }
} }

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.