Пример #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));
        }
Пример #2
0
 protected void When(PostHiddenDomainEvent @event)
 {
     published = false;
 }