void AppendReplies(CommentViewModel comment, List<CommentViewModel> allComments) { foreach(var reply in allComments.Where(a=>a.ParentId==comment.Id)) { comment.AddReply(reply); AppendReplies(reply, allComments); } }
void AppendReplies(CommentViewModel comment, List<CommentViewModel> allComments) { foreach(var reply in allComments.Where(a=>a.ParentId==comment.Id)) { comment.AddReply(reply); AppendReplies(reply, allComments); } }