public void Unpublish() { var @event = new PostUnpublished(); Apply(@event); AppendEvent(@event); }
public void Handle(PostUnpublished @event) { var collection = CreateCollection(); var find = Query.EQ("_id", @event.AggregateRootId); collection.Remove(find, RemoveFlags.Single); }
public void Handle(PostUnpublished @event) { var collection = CreateCollection(); var find = Query.EQ("_id", @event.AggregateRootId); var update = Update.Set("PublishedOn", DateTime.MinValue) .Set("IsPublished", false); collection.Update(find, update); }
public void Apply(PostUnpublished @event) { IsPublished = false; PublishedOn = default(DateTime); }