You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's a problem in how the thing is used to implement custom serialization of the events in a commit which impacts the database schema that is generated.
This interface is also used in different ways in each driver implementation and this should be documented
The original implementation did:
new BsonDocumentWrapper(typeof (EventMessage), serializer.Serialize(e))
which implied that the output of a serializer.Serialize method should have been something derived from EventMessage, but this wasn't evident from the documentation.
The actual implementation on develop does:
new BsonDocumentWrapper(serializer.Serialize(e))
there's no more nominal type usage anymore, so there's no more implicit inheritance of the object that will be serialized inside the payload, this will cause schema differences, because mongodb c# driver is now adding a "_t" attribute to each serialized object.
We should define correct usage of this interface, which IMO should be (to keep compatibility with the past):
in the serialize stage: output an EventMessage class (which sould be sealed in NEventStore) doing you custom serialization in the body property og the EventMessage itself.
in the deserialization stage: the input will be an EventMessage with a serialized body, decode it and produce another EventMessage with a deserialized output.
otherwise we can go for having a 'private' EventMessage-like class in the driver that we'll use to keep schema compatibility.
The text was updated successfully, but these errors were encountered:
due to Issue: #42 it's probably better at this tage to keep the
compatibility with the past regarding how the events are serialized in a
commit. We should rethink the whole usage of IDocumentSerializer.
There's a problem in how the thing is used to implement custom serialization of the events in a commit which impacts the database schema that is generated.
This interface is also used in different ways in each driver implementation and this should be documented
The original implementation did:
new BsonDocumentWrapper(typeof (EventMessage), serializer.Serialize(e))
which implied that the output of a serializer.Serialize method should have been something derived from EventMessage, but this wasn't evident from the documentation.
The actual implementation on develop does:
new BsonDocumentWrapper(serializer.Serialize(e))
there's no more nominal type usage anymore, so there's no more implicit inheritance of the object that will be serialized inside the payload, this will cause schema differences, because mongodb c# driver is now adding a "_t" attribute to each serialized object.
We should define correct usage of this interface, which IMO should be (to keep compatibility with the past):
otherwise we can go for having a 'private' EventMessage-like class in the driver that we'll use to keep schema compatibility.
The text was updated successfully, but these errors were encountered: