Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #92 from craiggwilson/csharp_438

CSHARP-438. Added AsQueryable extension method for a typed MongoCollecti...
  • Loading branch information...
commit fdda52edbcbdf76e2f12d39e84647c070e515a98 2 parents b8f2a4b + 16de376
@rstam rstam authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 Driver/Linq/LinqExtensionMethods.cs
View
12 Driver/Linq/LinqExtensionMethods.cs
@@ -35,6 +35,18 @@ public static IQueryable<T> AsQueryable<T>(this MongoCollection collection)
{
var provider = new MongoQueryProvider(collection);
return new MongoQueryable<T>(provider);
+ }
+
+ /// <summary>
+ /// Returns an instance of IQueryable{{T}} for a MongoCollection.
+ /// </summary>
+ /// <typeparam name="T">The type of the returned documents.</typeparam>
+ /// <param name="collection">The name of the collection.</param>
+ /// <returns>An instance of IQueryable{{T}} for a MongoCollection.</returns>
+ public static IQueryable<T> AsQueryable<T>(this MongoCollection<T> collection)
+ {
+ var provider = new MongoQueryProvider(collection);
+ return new MongoQueryable<T>(provider);
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.