Beispiel #1
0
        public void Publish()
        {
            var @event = new PostPublished(DateTime.UtcNow);

            Apply(@event);

            AppendEvent(@event);
        }
Beispiel #2
0
        public void Handle(PostPublished @event)
        {
            var collection = CreateCollection();

            var find   = Query.EQ("_id", @event.AggregateRootId);
            var update = Update.Set("PublishedOn", @event.PublishedOn)
                         .Set("IsPublished", true);

            collection.Update(find, update);
        }
Beispiel #3
0
 public void Apply(PostPublished @event)
 {
     IsPublished = true;
     PublishedOn = @event.PublishedOn;
 }
Beispiel #4
0
 public void Apply(PostPublished @event)
 {
     IsPublished = true;
     PublishedOn = @event.PublishedOn;
 }
Beispiel #5
0
        public void Publish()
        {
            var @event = new PostPublished(DateTime.UtcNow);

            Apply(@event);

            AppendEvent(@event);
        }