Ejemplo n.º 1
0
        public async Task <ActionResult> EditArticleModal(long articleId)
        {
            var article = await _blogAppService.GetArticleDetailAsync(articleId);

            var types = (await _blogAppService.GetArticleTypesAsync()).Items;

            return(View("_EditArticleModal", new EditArticleModalViewModel()
            {
                Article = article, ArticleTypes = types
            }));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Details(long id, int?typeId)
        {
            var article = await _blogAppService.GetArticleDetailAsync(id, true);

            ViewBag.Article = article;
            if (ViewBag.Article != null)
            {
                (ArticleOut up, ArticleOut down) = await _blogAppService.GetArticlesUpDownByIdAsync(id, typeId);

                ViewBag.ArticleTypeId = typeId;
                ViewBag.UpArticle     = up;
                ViewBag.DownArticle   = down;
                ViewBag.Comments      = (await _blogAppService.GetArticleCommentByIdAsync(id)).Items;
                //站点信息
                blogSite.Title    = $"{article.Title}-{blogSite.SiteName}";
                blogSite.KeyWords = string.Join(",", article.ArticleStrTags);
                blogSite.Desc     = article.Desc;
            }
            ViewBag.ArticleRecommend = await _blogAppService.GetArticlesRecommendByTypeIdAsync(typeId);

            return(await ViewAsync());
        }