mirror of
				https://github.com/nsnail/FreeSql.git
				synced 2025-11-04 09:15:27 +08:00 
			
		
		
		
	v1.10.0-preview1018 #490
This commit is contained in:
		@@ -680,8 +680,10 @@ namespace FreeSql.Internal
 | 
			
		||||
                case ExpressionType.ConvertChecked:
 | 
			
		||||
                    //var othercExp = ExpressionLambdaToSqlOther(exp, tsc);
 | 
			
		||||
                    //if (string.IsNullOrEmpty(othercExp) == false) return othercExp;
 | 
			
		||||
                    if (exp.IsParameter()) return ExpressionLambdaToSql((exp as UnaryExpression)?.Operand, tsc);
 | 
			
		||||
                    return formatSql(Expression.Lambda(exp).Compile().DynamicInvoke(), tsc.mapType, tsc.mapColumnTmp, tsc.dbParams); //bug: Where(a => a.Id = (int)enum)
 | 
			
		||||
                    var expOperand = (exp as UnaryExpression)?.Operand;
 | 
			
		||||
                    if (expOperand.Type.NullableTypeOrThis().IsEnum && exp.IsParameter() == false)
 | 
			
		||||
                        return formatSql(Expression.Lambda(exp).Compile().DynamicInvoke(), tsc.mapType, tsc.mapColumnTmp, tsc.dbParams); //bug: Where(a => a.Id = (int)enum)
 | 
			
		||||
                    return ExpressionLambdaToSql(expOperand, tsc);
 | 
			
		||||
                case ExpressionType.Negate:
 | 
			
		||||
                case ExpressionType.NegateChecked: return "-" + ExpressionLambdaToSql((exp as UnaryExpression)?.Operand, tsc);
 | 
			
		||||
                case ExpressionType.Constant: return formatSql((exp as ConstantExpression)?.Value, tsc.mapType, tsc.mapColumnTmp, null);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user