public void AddComment(string author, string content) { var commentId = Guid.NewGuid(); var @event = new CommentAdded(commentId, author, content); Apply(@event); AppendEvent(@event); }
public void Apply(CommentAdded @event) { _comments.Add(new Comment { Id = @event.CommentId, Approved = false, Author = @event.Author, Content = @event.Content }); }