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

Subclass of BsonDocument is not getting serialized

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 2.2.3
    • Component/s: Serialization
    • Environment:
      Windows 7 64 bit with C# driver 2.2.3 and MongoDB 3.2.3

      I have created a subclass from BsonDocument as below

      public class MyClassDocument : BsonDocument
      {

      }

      But, MyClassDocument class is not getting serialized while making calls to any of the API methods,

      Error Message:
      MongoDB.Driver.MongoCommandException: Command insert failed: error parsing element 0 of field documents :: caused by :: wrong type for '0' field, expected object, found 0: [ {}, {} ]

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            rajkalam2000@gmail.com Rajesh Reddy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: