Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-612

Generic query builder throws exception when Injected using LINQ

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 1.6
    • Component/s: None

      public class Document
      {
          public ObjectId Id { get; set; }
      }
      
      [Test]
      public void InjectGenericQueryBuilder()
      {
          var doc = _collection.AsQueryable<Document>().SingleOrDefault(x => Query<Document>.EQ(y => y.Id, ObjectId.Empty).Inject());
      }
      

      The following exception is thrown when this unit test is run:

      System.ArgumentException : Unsupported where clause: LinqToMongo.Inject...

      This is true for pretty much any Inject done using generic query builder.

      Note that the non-generic query builder (where field name is specified as magic string) works fine.

            Assignee:
            craig.wilson@mongodb.com Craig Wilson
            Reporter:
            zaidmasud Zaid Masud
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: