I\'ve an extension method, which returns an IQueryable, to get company products, I just want to use it in a IQueryable as a subquery,
public static class DBEntit
Problem is not IQueryable
inside IQueryable
, because you can include subqueries just not the way you did.
In your example whole Select
is represented as expression tree. In that expression tree there is something like :
CALL method DBEntitiesCompanyExtensions.GetCompanyProducts
Now EF should somehow traslate this into SQL SELECT statement. It cannot do that, because it cannot "look inside" GetCompanyProducts
method and see what is going on there. Nor can it execute this method and do anything with it's result. The fact it returns IQueryable
does not help and is not related.