mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-15 18:55:07 +08:00
-
This commit is contained in:
Binary file not shown.
@@ -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.
Binary file not shown.
@@ -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.
Reference in New Issue
Block a user