The attached code throws an InvalidOperationException() The LinqToMongo.Inject method is only intended to be used in LINQ Where clauses.
var point = new GeoJsonPoint<GeoJson2DGeographicCoordinates>(new GeoJson2DGeographicCoordinates(10, 10));
IMongoQuery query = Query<TestClass>.GeoIntersects(o => o.Coord, point);
var result = objectsCollection.AsQueryable().Where(x => query.Inject()).ToList(); // exception thrown here
In version 1.9.2 of c# driver this code was worked. I use LINQ Where. Why exception was thrown?
- is duplicated by
-
CSHARP-1445 Support arbitrary filters in the LINQ provider.
- Closed