mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-12-29 11:05:47 +08:00
- 增加 Where In 表达式解析;
- 增加 FreeSqlBuilder.UseConnectionFactory 自定义数据库连接对象的创建方法;
This commit is contained in:
@@ -660,6 +660,7 @@ namespace FreeSql.Internal
|
||||
case "Min":
|
||||
case "Max":
|
||||
case "Avg":
|
||||
case "ToList": //where in
|
||||
case "First":
|
||||
var anyArgs = exp3.Arguments;
|
||||
var exp3Stack = new Stack<Expression>();
|
||||
@@ -732,7 +733,8 @@ namespace FreeSql.Internal
|
||||
if (fsql == null) fsql = Expression.Lambda(exp3tmp).Compile().DynamicInvoke();
|
||||
fsqlType = fsql?.GetType();
|
||||
if (fsqlType == null) break;
|
||||
fsqlType.GetField("_limit", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(fsql, 1);
|
||||
if (exp3.Method.Name != "ToList")
|
||||
fsqlType.GetField("_limit", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(fsql, 1);
|
||||
fsqltables = fsqlType.GetField("_tables", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(fsql) as List<SelectTableInfo>;
|
||||
//fsqltables[0].Alias = $"{tsc._tables[0].Alias}_{fsqltables[0].Alias}";
|
||||
if (fsqltables != tsc._tables)
|
||||
@@ -915,6 +917,7 @@ namespace FreeSql.Internal
|
||||
if (string.IsNullOrEmpty(sqlSum) == false)
|
||||
return $"({sqlSum.Replace("\r\n", "\r\n\t")})";
|
||||
break;
|
||||
case "ToList":
|
||||
case "First":
|
||||
var tscClone2 = tsc.CloneDisableDiyParse();
|
||||
tscClone2.isDisableDiyParse = false;
|
||||
|
||||
Reference in New Issue
Block a user