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

Prevent registration of BsonValue related serializers

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.8
    • Affects Version/s: 1.7
    • Component/s: None
    • None

      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.

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

              Created:
              Updated:
              Resolved: