Exemplo n.º 1
0
Arquivo: Post.cs Projeto: mastoj/NBlog
 public void Publish()
 {
     if (_published)
     {
         throw new PostAlreadyPublishedException();
     }
     var publishTime = DateTime.Now;
     var publishEvent = new PostPublishedEvent(publishTime, AggregateId);
     Apply(publishEvent);
 }
Exemplo n.º 2
0
 public override void When()
 {
     _postPublihsedEvent = new PostPublishedEvent(DateTime.Now, _postId);
     PostView.Handle(_postPublihsedEvent);
 }
Exemplo n.º 3
0
Arquivo: Post.cs Projeto: mastoj/NBlog
 private void PostPublished(PostPublishedEvent postPublishedEventPublishedEvent)
 {
     _publishTime = postPublishedEventPublishedEvent.PublishTime;
     _published = true;
 }