- 优化 导航属性未配置关系先 Where 后 InnerJoin 的问题;

This commit is contained in:
2881099
2022-09-25 13:12:04 +08:00
parent 173fbff620
commit a301fdd130
2 changed files with 1 additions and 184 deletions

View File

@ -687,7 +687,7 @@ namespace FreeSql.Internal
else
{
var find = _tables.Where((a, c) => c > 0 &&
(a.Type == tbtype || a.Type == SelectTableInfoType.From) &&
(a.Type == tbtype || a.Type == SelectTableInfoType.From || a.Type == SelectTableInfoType.LeftJoin) &&
string.IsNullOrEmpty(a.On) &&
dicRegexAlias.GetOrAdd(a.Alias, alias => new Regex($@"\b{alias}\.", RegexOptions.Compiled)).IsMatch(sql)).LastOrDefault();
if (find != null)