Example #1
0
        public async Task <IActionResult> Update(int id)
        {
            var blogList = await _blogApiService.GetByIdAsync(id);

            return(View(new BlogUpdateModel {
                Id = blogList.Id,
                Title = blogList.Title,
                ShortDescription = blogList.ShortDescription,
                Description = blogList.Description
            }));
        }
Example #2
0
        public async Task <IActionResult> Update(int id)
        {
            TempData["active"] = "blog";
            var blog = await _blogApiService.GetByIdAsync(id);

            return(View(new BlogUpdateModel
            {
                Id = blog.Id,
                Title = blog.Title,
                ShortDescription = blog.ShortDescription,
                Description = blog.Description
            }));
        }
Example #3
0
        public async Task <IActionResult> Update(int id)
        {
            var blog = await _blogApiService.GetByIdAsync(id);

            var model = new BlogUpdateModel();

            model.Description      = blog.Description;
            model.Id               = blog.Id;
            model.ShortDescription = blog.ShortDescription;
            model.Title            = blog.Description;
            model.Image            = blog.Image;

            return(View(model));
        }
Example #4
0
        public async Task <IActionResult> Edit(int id)
        {
            var updatedBlog = await _blogApiService.GetByIdAsync(id);

            if (updatedBlog != null)
            {
                BlogUpdateModel blogModel = new BlogUpdateModel
                {
                    ShortDescription = updatedBlog.ShortDescription,
                    Title            = updatedBlog.Title,
                    Description      = updatedBlog.Description,
                    Id = updatedBlog.Id
                };
                return(View(blogModel));
            }
            return(NotFound());
        }
        public async Task <IActionResult> BlogDetail(int id)
        {
            ViewBag.Comments = await _blogApiService.GetCommentsAsync(id, null);

            return(View(await _blogApiService.GetByIdAsync(id)));
        }
Example #6
0
 public async Task <IActionResult> BlogDetail(int id)
 {
     return(View(await _blogApiService.GetByIdAsync(id)));
 }
Example #7
0
 // GET: Admin/Blogs/Details/5
 public async Task <IActionResult> Details(int?id)
 {
     TempData["active"] = "blog";
     return(View(await _blogApiService.GetByIdAsync((int)id)));
 }
        public async Task <IActionResult> Detail(int id)
        {
            var blog = await _blogApiService.GetByIdAsync(id);

            return(View(blog));
        }