- 修复 ToList 父子导航可能匹配不正确的 bug;

This commit is contained in:
28810
2020-03-03 12:36:44 +08:00
parent f0bd6cc625
commit a45cfff5f6
4 changed files with 277 additions and 1 deletions

View File

@ -1140,7 +1140,8 @@ namespace FreeSql.Internal
if (tsc.style == ExpressionStyle.SelectColumns)
{
finds = tsc._tables.Where(a => a.Table.Type == tbtmp.Type && a.Alias == alias).ToArray();
if (finds.Length != 1) finds = tsc._tables.Where(a => a.Table.Type == tbtmp.Type).ToArray();
if (finds.Any() == false && alias.Contains("__") == false)
finds = tsc._tables.Where(a => a.Table.Type == tbtmp.Type).ToArray();
if (finds.Any()) finds = new[] { finds.First() };
}
if (finds.Length != 1 && isa && parmExp != null)