예제 #1
0
        public async Task <IActionResult> OnGet()
        {
            if (Id == Guid.Empty)
            {
                return(RedirectToPage("/Blogs"));
            }

            ViewModel = await _blogService.GetBlogAsync(Id);

            return(Page());
        }
예제 #2
0
        public async Task <IActionResult> OnGet()
        {
            if (Id == Guid.Empty)
            {
                TempData["Warning"] = "An Id for selected Blog was not provided";
                return(RedirectToPage("/Admin/Blogs"));
            }

            var blog = await _blogService.GetBlogAsync(Id);

            ViewModel      = new BlogDetailsViewModel();
            ViewModel.Blog = new Blog();
            ViewModel.Blog = blog;

            return(Page());
        }
예제 #3
0
        public async Task <FileContentResult> OnGet()
        {
            var blog = await _blogData.GetBlogAsync(Id);

            return(File(blog.Banner, "image/jpeg"));
        }