public class Test
|
{
|
public ObjectId Id { get; set; }
|
public string Field;
|
public string PropertyThatWorks { get; set; }
|
public string PropertyThatDoesNotWork { get; }
|
}
|
|
class Program
|
{
|
private static readonly IMongoCollection<Test> collection = new MongoClient().GetDatabase("test").GetCollection<Test>("c");
|
|
static void Main(string[] args)
|
{
|
/* 1 - works */ var result = collection.Find(c => c.Field == "test").ToList();
|
/* 2 - works */ result = collection.Find(c => c.PropertyThatWorks == "test").ToList();
|
/* 3 - FAILS */ result = collection.Find(c => c.PropertyThatDoesNotWork == "test").ToList();
|
}
|
}
|