コード例 #1
0
ファイル: News.cs プロジェクト: rlasjunies/CQRS_trial
 private void UpdateFrom(NewsCreatedEvent @event)
 {
     Id = @event.NewsId;
     _title = @event.Title;
     _summary = @event.Summary;
     _content = @event.Content;
     _status = enumNewsStatus.Created;
 }
コード例 #2
0
 public void Handle(NewsCreatedEvent @event)
 {
     if (News.All(news => news.Id != @event.NewsId))
         News.Add(new NewsModel(@event.NewsId, @event.Title, @event.Summary, @event.Content));
 }