title: MongoDB Unknown discriminator value
body: <p>I've added the code in the answer to this question: <a href="https://stackoverflow.com/questions/7451422/unknown-discriminator-value-myevent">Unknown discriminator value &#39;MyEvent&#39;</a>, but it didn't help.</p>
  
  <p>An error occurred while deserializing the Body property of class EventStore.EventMessage: Unknown discriminator value : "Insert event name".
  Error only occurs when you try to rehydrate a saved object after program restart.</p>
  
  <p>Running latest MyGet Build</p>
  
  <p>Sample Repository:<a href="https://github.com/tonyeung/EventStore-MongoDB" rel="nofollow noreferrer">https://github.com/tonyeung/EventStore-MongoDB</a></p>
  
  <p>To replicate the issue:  </p>
  
  <p>run the program<br>
  press c to create a new record<br>
  press q to quit<br>
  run the program again<br>
  but press r to rehydrate<br>
  error triggers  </p>
  
  <p>If you run the program, press c, press enter to continue, and press r to rehydrate without quitting, the object is rehydrated without a problem. WAT?</p>
  
  <pre><code>        using (var eventStore = WireupEventStore())
          {
              var snapshot = eventStore.Advanced.GetSnapshot(ID, int.MaxValue);
              if (snapshot == null)
              {
                  // ERRORS HERE
                  using (var stream = eventStore.OpenStream(ID, 0, int.MaxValue))
                  {
                      var events = from s in stream.CommittedEvents
                                   select s.Body as IEvent;
  
                      obj.LoadsFromHistory(events);
                  }
              }
          }
  </code></pre>
  
  <p>github issue: <a href="https://github.com/NEventStore/NEventStore/issues/203" rel="nofollow noreferrer">https://github.com/NEventStore/NEventStore/issues/203</a></p>