I am trying to use linq in C# with mongodb per the tutorial here http://docs.mongodb.org/ecosystem/tutorial/use-linq-queries-with-csharp-driver/
I have:
The compiler complains that Error: Could not find an implementation of the query pattern...
What is missing?
---EDIT---
I have minimized the code here to illustrate the problem -
// .Net
using System.Collections.Generic;
// 3rd Party
using MongoDB.Bson;
using MongoDB.Driver;
using MongoDB.Driver.Builders;
using MongoDB.Driver.Linq;
namespace Chess2.Server {
public static partial class Database {
internal static MongoCollection<Document> Collection =
GetCollection<Document>();
}
public class Document {
public ObjectId Id;
public int Field;
public static IEnumerable<Document> Waiting() {
// HERE IS THE LINQ THAT DOESN"T WORK
return from item in
Database.Collection.AsQueryable<Document>()
where item.Field > 0
select item;
}
}
}
In order for a Linq provider to be found, one must not only have the using statement for the provider, but also System.Linq itself.