コード例 #1
0
        public async Task <IActionResult> TopicDetail(int id)
        {
            var topic = await _topicApiService.GetByIdAsync(id);

            if (topic != null)
            {
                ViewBag.Comments = await _topicApiService.GetCommentsAsync(id, null);

                return(View(await _topicApiService.GetByIdAsync(id)));
            }

            TempData["notFound"] = "Blog bulunamadı";
            return(RedirectToAction("Index"));
        }
コード例 #2
0
        public async Task <IActionResult> UpdateTopic(int id)
        {
            TempData["active"] = "topic";
            var topicList = await _topicApiService.GetByIdAsync(id);

            return(View(new TopicUpdateModel
            {
                Id = topicList.Id,
                Title = topicList.Title,
                Description = topicList.Description,
                ShortDescription = topicList.ShortDescription
            }));
        }