Пример #1
0
    internal static Comment Initialize(Guid userId, TargetEntity targetEntity, string text,
                                       Guid?repliedCommentId = null)
    {
        var comment = new Comment(Guid.NewGuid());

        comment.ApplyChange(new CommentCreatedEvent(comment.Id, comment.GetNextVersion(), userId, targetEntity.Type,
                                                    targetEntity.Id, text, repliedCommentId));

        return(comment);
    }