我将尝试在EF Core 3.1中进行组合连接,但是它返回以下问题:
处理LINQ表达式'DbSet失败。这可能表示EF Core中的错误或限制
我的代码如下:
var employees = await (from enrollment in RepositoryContext.Enrollments
join allowance in RepositoryContext.Allowances.Include(y=>y.AllowanceType) on enrollment.EmployeeId equals allowance.EmployeeId
into allowances
select new
{
enrollment,
allowances
}
).AsNoTracking().ToListAsync();
这个allowances是一个项目列表, 有没有什么变通方法可以运行像这样的查询,因为我需要它来提高性能。