public ArticleModel(IArticleService articleService, IUserService userService) { _articleService = articleService; _userService = userService; Model = new DisplayArticleModel { Comments = new List <CommentEntity>() }; CreateModel = new CreateCommentModel(); }
private void GetArticle() { var article = _articleService.GetArticleById(Id); var author = _userService.GetUsernameById(article.UserId); Model = new DisplayArticleModel { DatePublished = article.DatePublished, Author = author, Content = article.Content, Title = article.Title, ArticleCategoryId = article.ArticleCategoryId }; }