예제 #1
0
        public ArticleModel(IArticleService articleService,
                            IUserService userService)
        {
            _articleService = articleService;
            _userService    = userService;

            Model = new DisplayArticleModel {
                Comments = new List <CommentEntity>()
            };
            CreateModel = new CreateCommentModel();
        }
예제 #2
0
        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
            };
        }