While migrating from Entity Framework 6 to EF Core 3, I'm hitting this error:
InvalidOperationException: Processing of the LINQ expression '(<>h__TransparentIdentifier0) => <>h__TransparentIdentifier0.grp' by 'NavigationExpandingExpressionVisitor' failed.
I believe this relates to some type of client side evaluation but I'm not sure how to fix. I essentially have this query:
var query = from s in ...
join ...
join ...
select new DTO {
Latest = (from r in _context.IndicatorCsLabUtilization
where r.LabSpaceId == s.Id
group r by r.LabSpaceId into grp
let maxDate = grp.Max(g => g.AssessmentDate)
from g in grp
where g.AssessmentDate == maxDate
select new EfficiencyAssessmentDto {
Comments = null,
Percent = g.Utilization,
When = g.AssessmentDate
}).FirstOrDefault(),
....
That "Latest" one is the part that's causing the failure. Can somebody help me understand how to fix that now broken query?