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

Prevent registration of BsonValue related serializers

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 1.8
    • 1.7
    • None
    • None

    Description

      When serializing BsonValues we don't call LookupSerializer for the different serializers needed, we use static instances for performance reasons (no locking contention, no dictionary lookup).

      Therefore, we should throw an exception if an attempt is made to register a serializer for any of the BsonValue subclasses, since they won't be used anyway and allowing them to be registered is misleading.

      We do this partially now (you can't register a serializer for BsonDocument), but we need to do it for all BsonValue subclasses.

      Attachments

        Activity

          People

            robert@mongodb.com Robert Stam
            robert@mongodb.com Robert Stam
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: