Merge pull request #1417 from xuejmnet/master

优化当props属性过多时的判断
This commit is contained in:
2881099 2023-02-10 14:43:35 +08:00 committed by GitHub
commit 3fda79f2fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -632,7 +632,7 @@ namespace FreeSql.Internal.CommonProvider
a.Alias.StartsWith($"{tb.Alias}__") && //开头结尾完全匹配
a.Alias.EndsWith($"__{prop.Name}") //不清楚会不会有其他情况 求大佬优化
).FirstOrDefault(); //判断 b > 0 防止 parent 递归关系
if (tb2 == null && props.Where(pw => pw.Value.PropertyType == prop.PropertyType).Count() == 1)
if (tb2 == null && props.Where(pw => pw.Value.PropertyType == prop.PropertyType).Take(2).Count() == 1)
tb2 = _tables.Where((a, b) => b > 0 &&
(a.Type == SelectTableInfoType.InnerJoin || a.Type == SelectTableInfoType.LeftJoin || a.Type == SelectTableInfoType.RightJoin) &&
string.IsNullOrEmpty(a.On) == false &&