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

            ViewModel = await _blogService.GetBlogAsync(Id);

            return(Page());
        }
Exemplo n.º 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());
        }
Exemplo n.º 3
0
        public async Task <FileContentResult> OnGet()
        {
            var blog = await _blogData.GetBlogAsync(Id);

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