From d4e28fd0ebd5fb980686d83d2913a98e4ad156af Mon Sep 17 00:00:00 2001 From: Alessandro Giorgetti Date: Wed, 3 Aug 2016 14:44:09 +0200 Subject: [PATCH] Reverted the way IDocumentSerializer is used 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. --- src/NEventStore.Persistence.MongoDB/ExtensionMethods.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/NEventStore.Persistence.MongoDB/ExtensionMethods.cs b/src/NEventStore.Persistence.MongoDB/ExtensionMethods.cs index a8a80cc..35174eb 100644 --- a/src/NEventStore.Persistence.MongoDB/ExtensionMethods.cs +++ b/src/NEventStore.Persistence.MongoDB/ExtensionMethods.cs @@ -44,7 +44,7 @@ public static BsonDocument ToMongoCommit(this CommitAttempt commit, Int64 checkp new BsonDocument { {MongoCommitFields.StreamRevision, streamRevision++}, - {MongoCommitFields.Payload, BsonDocumentWrapper.Create(serializer.Serialize(e))} + {MongoCommitFields.Payload, BsonDocumentWrapper.Create(typeof(EventMessage), serializer.Serialize(e))} }).ToList(); var mc = new MongoCommit @@ -76,7 +76,7 @@ public static BsonDocument ToEmptyCommit(this CommitAttempt commit, Int64 checkp new BsonDocument { {MongoCommitFields.StreamRevision, streamRevision++}, - {MongoCommitFields.Payload, BsonDocumentWrapper.Create(serializer.Serialize(e))} + {MongoCommitFields.Payload, BsonDocumentWrapper.Create(typeof(EventMessage), serializer.Serialize(e))} }); var mc = new MongoCommit @@ -107,7 +107,7 @@ public static BsonDocument ToMongoCommit_original(this CommitAttempt commit, Int new BsonDocument { {MongoCommitFields.StreamRevision, streamRevision++}, - {MongoCommitFields.Payload, BsonDocumentWrapper.Create(serializer.Serialize(e))} + {MongoCommitFields.Payload, BsonDocumentWrapper.Create(typeof(EventMessage), serializer.Serialize(e))} }); //var dictionarySerialize = new DictionaryInterfaceImplementerSerializer>(DictionaryRepresentation.ArrayOfArrays);