I've been working with EF for a while, and while I find it great, there's something that struggles my mind.
Let's say I'm talking about the classic Order / OrderDetails relationship. DbContext generated and everything. Among other properties, I have a navigation property ICollection OrderDetails inside class Order.
Now, why there is no clean way to use that navigation property as an IQueryable property? That way, I could make something like this with good performance, running the WHERE on SQL side:
var argDetails = order.OrderDetails.Where(d => d.Active==true);
or even...
order.OrderDetails.Count();
Instead, this fetches all the related Details into memory and filters/counts using EntityToObjects...
Totally not performant.
Any good reason behind this?
Thanks