Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 public void OnBeforePersisting(EventStream eventStream)
 {
     var evnt = eventStream.FindEvent<UserRegistered>();
     GetMongoCollection().Insert(new BsonDocument
     {
         { "_id", evnt.UserId.ToString() },
         { "UserName", evnt.UserName },
         { "Status", 1 }
     });
 }