public ArticleCommentViewModel(ArticleComment comment) { if (comment != null) { ID = comment.ID; Author = new UserViewModel(comment.Author); Text = comment.Text; IsReply = comment.IsReply; ParentComment = new ArticleCommentViewModel(comment.ParentComment); Date = comment.Date; } }
public ArticleCommentViewModel(ArticleComment comment, List <ArticleComment> replies) { if (comment != null) { ID = comment.ID; Author = new UserViewModel(comment.Author); Text = comment.Text; IsReply = comment.IsReply; ParentComment = new ArticleCommentViewModel(comment.ParentComment); Replies = replies.Select(x => new ArticleCommentViewModel(x)).ToList(); Date = comment.Date; } }