Using 3.0.1
ctx.SnatchJobs
.GroupBy(sj => sj.PaymentDate)
.Select(g => new
{
NrCancelled = g.Count(sj => sj.Status == SnatchJobStatus.Cancelled),
NrFailed = g.Count(sj => sj.Status == SnatchJobStatus.Failed)
}).ToList();
generates
SELECT COUNT(*)::INT AS "NrCancelled", COUNT(*)::INT AS "NrFailed"
FROM "SnatchJob" AS l
GROUP BY l."PaymentDate"
The count predicates are lost.
/cc @smitpatel
Duplicate of https://github.com/aspnet/EntityFrameworkCore/issues/11711
Can throw exception rather than silent ignore.
@smitpatel thanks. Definitely makes sense to throw rather than return incorrect results... New issue for 3.1?
Most helpful comment
Fixing in https://github.com/aspnet/EntityFrameworkCore/pull/18553