- 修复 子查询使用基类+AsType 可能产生的 bug;#1215

This commit is contained in:
2881099
2022-08-14 00:04:35 +08:00
parent 064cb82cf0
commit f49c5f2827
4 changed files with 91 additions and 11 deletions

View File

@ -1767,13 +1767,18 @@ namespace FreeSql.Internal
if (finds.Length != 1)
{
finds = tsc._tables.Where(a2 => (isa && a2.Parameter != null || isa && a2.Parameter == null) &&
a2.Table.Type == tbtmp.Type).ToArray();
tbtmp.Type.IsAssignableFrom(a2.Table.Type) && a2.Alias == alias).ToArray();
if (finds.Length != 1)
{
finds = tsc._tables.Where(a2 => (isa && a2.Parameter != null || isa && a2.Parameter == null) &&
a2.Table.Type == tbtmp.Type).ToArray();
if (finds.Length != 1)
finds = tsc._tables.Where(a2 => a2.Table.Type == tbtmp.Type).ToArray();
{
finds = tsc._tables.Where(a2 => (isa && a2.Parameter != null || isa && a2.Parameter == null) &&
a2.Table.Type == tbtmp.Type).ToArray();
if (finds.Length != 1)
finds = tsc._tables.Where(a2 => a2.Table.Type == tbtmp.Type).ToArray();
}
}
}
}