public ViewCommentsViewModel(ArticleModel article, int page) { this.Article = article; this.TotalComments = article.CachedCommentCount; this.Comments = CommentModel.FromArticle(article, (page - 1) * CommentsPerPage, CommentsPerPage); this.PageNumber = page; this.Comment = new CommentFormModel(); }
public ViewCommentsViewModel(ArticleModel article) { this.Article = article; this.Comments = CommentModel.FromArticle(article); if (this.Article.CachedCommentCount > 1) { this.DiscourseNextUnreadCommentUrl = this.Article.DiscourseThreadUrl + "/" + this.Article.CachedCommentCount; } else { this.DiscourseNextUnreadCommentUrl = this.Article.DiscourseThreadUrl; } }