Esempio n. 1
0
        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));
        }
Esempio n. 2
0
 protected void When(PostHiddenDomainEvent @event)
 {
     published = false;
 }