- 完善 $"{id}_{name}" lambda 解析与测试;

This commit is contained in:
28810
2020-07-05 06:32:13 +08:00
parent 1d48f17f81
commit d61997d1b2
33 changed files with 442 additions and 35 deletions

View File

@ -246,6 +246,11 @@ namespace FreeSql.Odbc.MySql
return $"({arg2} is null or {arg2} = '' or ltrim({arg2}) = '')";
case "Concat":
return _common.StringConcat(exp.Arguments.Select(a => getExp(a)).ToArray(), null);
case "Format":
if (exp.Arguments[0].NodeType != ExpressionType.Constant) throw new Exception($"未实现函数表达式 {exp} 解析,参数 {exp.Arguments[0]} 必须为常量");
if (exp.Arguments.Count == 1) return ExpressionLambdaToSql(exp.Arguments[0], tsc);
var expArgs = exp.Arguments.Where((a, z) => z > 0).Select(a => $"',{ExpressionLambdaToSql(a, tsc)},'").ToArray();
return $"concat({string.Format(ExpressionLambdaToSql(exp.Arguments[0], tsc), expArgs)})";
}
}
else