예제 #1
0
파일: Post.cs 프로젝트: mastoj/NBlog
 public void Publish()
 {
     if (_published)
     {
         throw new PostAlreadyPublishedException();
     }
     var publishTime = DateTime.Now;
     var publishEvent = new PostPublishedEvent(publishTime, AggregateId);
     Apply(publishEvent);
 }
예제 #2
0
 public override void When()
 {
     _postPublihsedEvent = new PostPublishedEvent(DateTime.Now, _postId);
     PostView.Handle(_postPublihsedEvent);
 }
예제 #3
0
파일: Post.cs 프로젝트: mastoj/NBlog
 private void PostPublished(PostPublishedEvent postPublishedEventPublishedEvent)
 {
     _publishTime = postPublishedEventPublishedEvent.PublishTime;
     _published = true;
 }