-
Type:
New Feature
-
Resolution: Won't Fix
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: Serialization
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
I originally posted this here before realizing it should probably have gone in Jira as a feature request?
With release 2.19.0 we now have to register our types in order for them to be serialized. The suggestion in the release notes here is to do the following…
var objectSerializer = new ObjectSerializer(type => ObjectSerializer.DefaultAllowedTypes(type) || type.FullName.StartsWith("MyNamespace")); BsonSerializer.RegisterSerializer(objectSerializer);
This works, however, at the company I work we explicitly register all our types using BsonClassMap.RegisterClassMap<T>(...) to avoid accidents when serializing/deserializing.
Given that we’re already being explicit about the types we want registered could the library note these types and add them to the allowed types automatically.