Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSHARP-438. Added AsQueryable extension method for a typed MongoCollecti... #92

Merged
merged 1 commit into from Apr 11, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions Driver/Linq/LinqExtensionMethods.cs
Expand Up @@ -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);
}
}
}