Selecting from a IMongoQueryable collection with a Linq Expression throws an error because of 'Id' property

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 2.3
    • Affects Version/s: 2.2.4
    • Component/s: LINQ, Serialization
    • None
    • Environment:
      Windows 7 64bits
    • None
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None

      Using the mongoDb c# driver 2.2.4, selecting from a IMongoQueryable collection with a Linq Expression throws an error because of my Id field.

      The exception thrown is 'Element 'Id' does not match any field or property of class MongoDbHierarchicalStoring.Man.'

      You can find more info on the stackoverflow post: http://stackoverflow.com/questions/38508622/selecting-from-a-imongoqueryable-collection-with-a-linq-expression-throws-an-err

      If I change my 'Id' property and rename it '_id', it worked. But in a prior version of the driver (2.1.1) it used to work fine.
      The sample you can find in the attached file proves it : testing with the old version of the driver retrieves the data where as the new version throws an exception.

        1. bug.cs
          2 kB
        2. CSHARP-1719-Regression.zip
          1 kB

              Assignee:
              Unassigned
              Reporter:
              Florent BROUCA
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: