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;
|
reval = objReference;
|
||||||
return reval;
|
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)
|
public static string GetMemberName(Expression expression)
|
||||||
{
|
{
|
||||||
if (expression is LambdaExpression)
|
if (expression is LambdaExpression)
|
||||||
|
@ -130,7 +130,7 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
else if (IsConst(item))
|
else if (IsConst(item))
|
||||||
{
|
{
|
||||||
base.Expression = item;
|
base.Expression =ExpressionTool.RemoveConvert(item);
|
||||||
base.Start();
|
base.Start();
|
||||||
string parameterName = this.Context.SqlParameterKeyWord + ExpressionConst.Const + this.Context.ParameterIndex;
|
string parameterName = this.Context.SqlParameterKeyWord + ExpressionConst.Const + this.Context.ParameterIndex;
|
||||||
parameter.Context.Result.Append(base.Context.GetEqString(memberName, parameterName));
|
parameter.Context.Result.Append(base.Context.GetEqString(memberName, parameterName));
|
||||||
|
Loading…
Reference in New Issue
Block a user