ExtraElements containing POCO classes fail to serialize

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Unresolved
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Serialization
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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
              Reporter:
              Ahmed Fwela
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: