C# LINQ Include未按预期工作.net core 3.1

C# LINQ Include未按预期工作.net core 3.1,c#,entity-framework,linq,.net-core,C#,Entity Framework,Linq,.net Core,我刚刚将应用程序从.net core 2.2升级到.net core 3.1 遇到这个问题。我有以下方法: var firstResult = await _context.UserCompany.Include(x => x.User).ToListAsync(); 及 在firstResult中,将填充导航属性User。 在secondResult中,导航属性User为空 为什么呢 var secondResult = await _context.UserCompany.Inclu

我刚刚将应用程序从.net core 2.2升级到.net core 3.1

遇到这个问题。我有以下方法:

var firstResult = await _context.UserCompany.Include(x => x.User).ToListAsync();

firstResult中,将填充导航属性User。 在secondResult中,导航属性User为空

为什么呢

var secondResult = await _context.UserCompany.Include(x => x.User)
                                             .Where(x=>x.IsExecutive).ToListAsync();