- 修复 AsTable 子查询未传播的 bug;#1103

This commit is contained in:
2881099
2022-06-09 13:59:27 +08:00
parent 7e2b0526c5
commit 38c6796b67
14 changed files with 109 additions and 100 deletions

View File

@@ -993,6 +993,7 @@ namespace FreeSql.Internal
break;
}
object fsql = null;
Select0Provider fsqlSelect0 = null;
List<SelectTableInfo> fsqltables = null;
var fsqltable1SetAlias = false;
Type fsqlType = null;
@@ -1071,9 +1072,7 @@ namespace FreeSql.Internal
if (fsql == null) fsql = Expression.Lambda(exp3tmp).Compile().DynamicInvoke();
fsqlType = fsql?.GetType();
if (fsqlType == null) break;
var fsqlSelect0 = fsql as Select0Provider;
if (tsc._tableRule != null)
fsqlSelect0._tableRules.Add(tsc._tableRule);
fsqlSelect0 = fsql as Select0Provider;
switch (exp3.Method.Name)
{
case "Any": //exists
@@ -1196,6 +1195,9 @@ namespace FreeSql.Internal
}
if (fsql != null)
{
if (fsqlSelect0 != null && tsc._tableRule != null && fsqlSelect0._tableRules.Any() == false)
fsqlSelect0._tableRules.Add(tsc._tableRule);
if (asSelectParentExp != null)
{
//执行 AsSelect() 的关联OneToManyManyToManyPgArrayToMany