- 优化 ISelect.GroupBy 查询,增加 .Value 实现聚合源字段查询,ToList(a => a.Sum(a.Value.Score));

- 增加 Expression string.Concat;
This commit is contained in:
28810
2019-04-25 12:34:09 +08:00
parent ddd5e81a67
commit 02ab4949c0
44 changed files with 466 additions and 86 deletions

View File

@ -208,6 +208,8 @@ namespace FreeSql.Sqlite {
case "IsNullOrEmpty":
var arg1 = getExp(exp.Arguments[0]);
return $"({arg1} is null or {arg1} = '')";
case "Concat":
return _common.StringConcat(exp.Arguments.Select(a => getExp(a)).ToArray(), null);
}
} else {
var left = getExp(exp.Object);

View File

@ -61,7 +61,7 @@ namespace FreeSql.Sqlite {
}
internal override string QuoteParamterName(string name) => $"@{(_orm.CodeFirst.IsSyncStructureToLower ? name.ToLower() : name)}";
internal override string IsNull(string sql, object value) => $"ifnull({sql}, {value})";
internal override string StringConcat(string left, string right, Type leftType, Type rightType) => $"{left} || {right}";
internal override string StringConcat(string[] objs, Type[] types) => $"{string.Join(" || ", objs)}";
internal override string Mod(string left, string right, Type leftType, Type rightType) => $"{left} % {right}";
internal override string QuoteWriteParamter(Type type, string paramterName) => paramterName;