Browse Source

Update exp tosql

pull/12/MERGE
sunkaixuan 6 years ago
parent
commit
265ad0f933
  1. 5
      Src/Asp.Net/SqlSugar/ExpressionsToSql/Common/ExpressionTool.cs
  2. 6
      Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MethodCallExpressionResolve.cs

5
Src/Asp.Net/SqlSugar/ExpressionsToSql/Common/ExpressionTool.cs

@ -255,5 +255,10 @@ namespace SqlSugar
{
return !IsEntity(type);
}
public static bool IsUnConvertExpress(Expression item)
{
return item is UnaryExpression && item.NodeType == ExpressionType.Convert;
}
}
}

6
Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MethodCallExpressionResolve.cs

@ -297,6 +297,10 @@ namespace SqlSugar
private void AppendItem(ExpressionParameter parameter, string name, IEnumerable<Expression> args, MethodCallExpressionModel model, Expression item)
{
if (ExpressionTool.IsUnConvertExpress(item))
{
item = (item as UnaryExpression).Operand;
}
var isBinaryExpression = item is BinaryExpression || item is MethodCallExpression;
var isConst = item is ConstantExpression;
var isIIF = name == "IIF";
@ -343,6 +347,8 @@ namespace SqlSugar
AppendModel(parameter, model, item);
}
}
private void AppendModelByIIFMember(ExpressionParameter parameter, MethodCallExpressionModel model, Expression item)
{
parameter.CommonTempData = CommonTempDataType.Result;

Loading…
Cancel
Save