Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
 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;
     }
 }