[CSHARP-656] Prevent registration of BsonValue related serializers Created: 04/Jan/13  Updated: 20/Mar/14  Resolved: 04/Jan/13

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 1.7
Fix Version/s: 1.8

Type: Improvement Priority: Minor - P4
Reporter: Robert Stam Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 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.



 Comments   
Comment by auto [ 04/Jan/13 ]

Author:

{u'date': u'2013-01-04T15:59:25Z', u'email': u'robert@10gen.com', u'name': u'rstam'}

Message: CSHARP-656: Prevent registration of BsonValue related serializers.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/a5d7325577a80504a6ff4bd7045f0da649d61eeb

Generated at Wed Feb 07 21:37:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.