|
Thank you for finding this issue and submitting a fix. Typically when serializing/deserializing POCOs, the types of the properties and fields are explicitly specified. The issue only manifests when the type of a property or field is specified as System.Object and the actual underlying type has direct mapping to BSON type (like DateTime). For other types the registered serializers will be used.
This issue can be mitigated by:
1. Specifying the explicit type of the property or field (if possible).
2. Registering a custom serializer for the containing type.
Although your fix appears simple, it alters the serialization/deserialization of existing types and may unexpectedly break applications depending on current serialization behaviour. As such we consider it too risky of a change to be implemented without deeper consideration. We will consider this use case and fix in some upcoming work to improve our serialization infrastructure.
|