コード例 #1
0
        public AnswerEntity Execute(AnswerModel from)
        {
            var entity = new AnswerEntity(
                from.Body,
                from.UserId,
                (AnswerKind)from.KindOf,
                from.Votes
                );

            entity.DefineId(from.Id);
            from.Comments.ToList().ForEach(comment =>
            {
                var newComment = _commentFactory.Execute(comment);
                newComment.SetParent(entity);
                entity.AddComment(newComment);
            });
            return(entity);
        }