LinqToMongo.Inject throws InvalidOperationException

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Duplicate
    • Priority: Blocker - P1
    • None
    • Affects Version/s: 2.0.1
    • Component/s: LINQ
    • Environment:
      Window 8 64 bit
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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?

        1. Program.cs
          4 kB
          Ilya

              Assignee:
              Unassigned
              Reporter:
              Ilya
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: