private void UpdateFrom(NewsCreatedEvent @event) { Id = @event.NewsId; _title = @event.Title; _summary = @event.Summary; _content = @event.Content; _status = enumNewsStatus.Created; }
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)); }