IQueryable
is an abstraction of the database query, but the features provided by IQueryable
are dependent on the provider and that makes it a leaky abstraction. Many advocate that IQueryable
shouldn't get out of the data layer: Using the repository pattern to support multiple providers
Most developers are striving to keep POCO's unpolluted by dependencies. Foreign keys and virtual methods are a compromise that most people will put up with but IQueryable
is probably a step too far.
You can vote for filtered includes here: Allow filtering for Include extension method
References: