Ejemplo n.º 1
0
        public void Publish()
        {
            if (enabled == false)
            {
                throw new DomainException("The blog is disabled. Enable this before making any changes.");
            }

            if (published == true)
            {
                throw new DomainException("The post is already published.");
            }

            Raise(PostPublishedDomainEvent.Create(this));
        }
Ejemplo n.º 2
0
 protected void When(PostPublishedDomainEvent @event)
 {
     published = true;
 }