I'm trying to achieve the following in LINQ (EF6):
SELECT count(A), sum(B), average(C)
FROM TableA,
LEFT JOIN TableB ON ...
LEFT JOIN TableC ON ...
WHERE
(very complicated conditions)
The C# code looks like following:
IQueryable<Entity> = dbSet
.Include(e => e.entityB)
.Include(e => e.EntityC)
.Where( <very complicated conditions> );
How can I apply multiple aggregate functions on different fields? Specifically, in a way, which won't cause the complicated conditions to be copied over and over in resulting query?