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

ExtraElements containing POCO classes fail to serialize

    • Type: Icon: New Feature New Feature
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Serialization
    • None

      Summary

      When serializing a POCO class in ExtraElements, I get 
      __

      .NET type xxxx cannot be mapped to a BsonValue.

      Driver version: 2.19

      How to Reproduce

      The problem is in the code here

      Github Link

      It's using

      BsonTypeMapper.MapToBsonValue

       on all fields, which will fail for class maps

      Additional Background

      The POCO classes are owned by another library, and I have no access to them, so the only way I can customize their behavior is by manipulating ExtraElements

            Assignee:
            boris.dogadov@mongodb.com Boris Dogadov
            Reporter:
            ahmednfwela@bdaya-dev.com Ahmed Fwela
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: