[CSHARP-438] Add a new overload of AsQueryable<T> that deduces <T> from its MongoCollection<T> argument Created: 11/Apr/12  Updated: 02/Apr/15  Resolved: 12/Apr/12

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 1.4
Fix Version/s: 1.4.1

Type: Improvement Priority: Major - P3
Reporter: Robert Stam Assignee: Craig Wilson
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The AsQueryable<T> extension method is currently declared as:

public static IQueryable<T> AsQueryable<T>(this MongoCollection collection)

and this requires you to provide the <T> argument explicitly. This is not a bad thing in a schema free database where the same collection can contain different kinds of documents. In practice though, it is common for a collection to contain only a single kind of document, and adding the following new overload of AsQueryable<T> would allow <T> to be deduced from the collection:

public static IQueryable<T> AsQueryable<T>(this MongoCollection<T> collection)

I can't see any reason why the two overloads can't coexist.



 Comments   
Comment by Craig Wilson [ 12/Apr/12 ]

Implemented and pushed to master.

Generated at Wed Feb 07 21:36:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.