public void OnAfterPersisted(EventStream eventStream)
 {
     var evnt = eventStream.FindEvent<UserRegistered>();
     var collection = GetMongoCollection();
     var document = collection.FindOneById(new BsonString(evnt.UserId.ToString()));
     document["Status"] = 2;
     collection.Save(document);
 }
 public void OnBeforePersisting(EventStream eventStream)
 {
     var evnt = eventStream.FindEvent<UserRegistered>();
     GetMongoCollection().Insert(new BsonDocument
     {
         { "_id", evnt.UserId.ToString() },
         { "UserName", evnt.UserName },
         { "Status", 1 }
     });
 }