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
ee948ce685
commit
0d440998df
@ -182,6 +182,23 @@ namespace SqlSugar
|
||||
reval = objReference;
|
||||
return reval;
|
||||
}
|
||||
|
||||
internal static Expression RemoveConvert(Expression item)
|
||||
{
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
if ((item is UnaryExpression) && (item as UnaryExpression).NodeType == ExpressionType.Convert)
|
||||
{
|
||||
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 = item;
|
||||
base.Expression =ExpressionTool.RemoveConvert(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