title: Unknown discriminator value 'MyEvent'
body: <p>Using the MongoDB persistance engine in <a href="https://github.com/joliver/EventStore" rel="noreferrer">joliver/EventStore</a> causing the error <code>Unknown discriminator value 'MyEvent'</code>. The issue is only caused when I try to load all events for replaying the events like <code>this.storeEvent.Advanced.GetFrom(new DateTime(2010, 1,1))</code></p>
  
  <p>The issues is caused in ExtensionsMethods.cs </p>
  
  <pre class="lang-cs prettyprint-override"><code>public class MyClassEvent : IDomainEvent { ... }
  
  public static Commit ToCommit(this BsonDocument doc, IDocumentSerializer serializer)
      {
          if (doc == null)
              return null;
  
          var id = doc["_id"].AsBsonDocument;
          var streamId = id["StreamId"].AsGuid;
          var commitSequence = id["CommitSequence"].AsInt32;
  
          var events = doc["Events"].AsBsonArray.Select(e =&gt; e.AsBsonDocument["Payload"].IsBsonDocument ? BsonSerializer.Deserialize&lt;EventMessage&gt;(e.AsBsonDocument["Payload"].AsBsonDocument) : serializer.Deserialize&lt;EventMessage&gt;(e.AsBsonDocument["Payload"].AsByteArray)).ToList();
          var streamRevision = doc["Events"].AsBsonArray.Last().AsBsonDocument["StreamRevision"].AsInt32;
          return new Commit(
              streamId,
              streamRevision,
              doc["CommitId"].AsGuid,
              commitSequence,
              doc["CommitStamp"].AsDateTime,
              BsonSerializer.Deserialize&lt;Dictionary&lt;string, object&gt;&gt;(doc["Headers"].AsBsonDocument),
              events);
      }
  </code></pre>
  
  <p>My configuration is like this:</p>
  
  <pre class="lang-cs prettyprint-override"><code> Wireup.Init()                
              .UsingMongoPersistence(connectionName, new DocumentObjectSerializer())
              .UsingBsonSerialization()    
              .UsingAsynchronousDispatcher()                                
              .PublishTo(this.container.Resolve&lt;IPublishMessages&gt;())
              .Build();
  </code></pre>
  
  <p>But have tried almost all kind of serializer options. </p>