Пример #1
0
        public async Task <IActionResult> UpdateArticleAsync(int id)
        {
            Article UpdateArticle = await ArticleOperations.Get(id);

            ArticleUpdateModel updateArticle = new ArticleUpdateModel(UpdateArticle);

            return(View(updateArticle));
        }
Пример #2
0
        public async Task <IActionResult> ArticleView(int id)
        {
            Article article = await ArticleOperations.Get(id);

            List <Question> questions = await QuestionOperations.Get(id);

            ArticleViewViewModel articleViewViewModel = new ArticleViewViewModel
            {
                ArticleId   = article.ArticleId,
                Title       = article.Title,
                Author      = article.Author,
                Summary     = article.Summary,
                Tag         = article.Tag,
                HeaderImage = article.HeaderImage,
                Content     = article.Content,
                Questions   = questions
            };

            if (article != null)
            {
                return(View(articleViewViewModel));
            }
            return(RedirectToAction("Index"));
        }
Пример #3
0
        public async Task <IActionResult> DeletePageAsync(int id)
        {
            Article article = await ArticleOperations.Get(id);

            return(View(article));
        }