public void Hide() { if (enabled == false) { throw new DomainException("The post is disabled. Enable this before making any changes."); } if (published == false) { throw new DomainException("The post is already hidden."); } Raise(PostHiddenDomainEvent.Create(this)); }
protected void When(PostHiddenDomainEvent @event) { published = false; }