mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Update exp to sql
This commit is contained in:
parent
9fe8c5fd94
commit
e08444d161
@ -198,7 +198,23 @@ namespace SqlSugar
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
internal static Expression RemoveConvertThanOne(Expression item)
|
||||
{
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
if ((item is UnaryExpression)
|
||||
&& (item as UnaryExpression).NodeType == ExpressionType.Convert
|
||||
&& (item as UnaryExpression).Operand is UnaryExpression)
|
||||
{
|
||||
item = (item as UnaryExpression).Operand;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
return item;
|
||||
}
|
||||
public static string GetMemberName(Expression expression)
|
||||
{
|
||||
if (expression is LambdaExpression)
|
||||
|
@ -130,7 +130,7 @@ namespace SqlSugar
|
||||
}
|
||||
else if (IsConst(item))
|
||||
{
|
||||
base.Expression = ExpressionTool.RemoveConvert(item);
|
||||
base.Expression =ExpressionTool.RemoveConvertThanOne(item);
|
||||
base.Start();
|
||||
string parameterName = this.Context.SqlParameterKeyWord + ExpressionConst.Const + this.Context.ParameterIndex;
|
||||
parameter.Context.Result.Append(base.Context.GetEqString(memberName, parameterName));
|
||||
|
Loading…
Reference in New Issue
Block a user