Consider supporting nested AsQueryable, for example:
collection.AsQueryable().Select(x => x.List.AsQueryable().Count())
and treat is as equivalent to:
collection.AsQueryable().Select(x => x.List.Count())
Using nested AsQueryable in this way doesn't make much sense, but it is legal C#.
The primary motivation for this change is to support the MongoDB EF Core Provider. Apparently EF Core inserts this call to AsQueryable and rewrites the expressions using the equivalent Queryable methods for each Enumerable method. Why it does this doesn't make much sense, but if we were to support this odd usage in the C# driver's LINQ provider it would make implementing the MongoDB EF Core Provider easier (otherwise the MongoDB EF Core Provider would have to undo what EF Core did to remove the unecessary AsQueryable).
- depends on
-
CSHARP-4863 Refactor AggregateMethodToAggregationExpressionTranslator to produce simpler translations when possible
- Closed
- is depended on by
-
EF-63 Can't query on arrays of sub-documents
- Closed