Closed AGiorgetti closed 8 years ago
Please review the PR: #32 as it is a fix for this issue.
Maybe we should rewrite the whole serialization and instead of writing the DSonDocument directly (as it is now) we should follow the approach that @andreabalducci used. This way we can allow the users -through the MongoDB mapping API - to change how the whole Commit is serialized.
Will be closed when implementing https://github.com/NEventStore/NEventStore.Persistence.MongoDB/issues/38
Look at the functions in ExtensionMethods.cs and double check how the serialization of each field was made, for example:
ToMongoCommit() at the end does: return mc.ToBsonDocument(); which uses all the configured MongoDB custom serialization conventions that can be registered.
in the ToCommit() we do something like: doc[MongoCommitFields.CommitStamp].ToUniversalTime() we are skipping any custom serialization or convention here (other fields do the same).
If you do not setup the conventions in a correct way (that is ignoring anything exposed by this driver) you will end up with runtime serialization errors.