public async Task <IActionResult> OnGet() { if (Id == Guid.Empty) { return(RedirectToPage("/Blogs")); } ViewModel = await _blogService.GetBlogAsync(Id); return(Page()); }
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()); }
public async Task <FileContentResult> OnGet() { var blog = await _blogData.GetBlogAsync(Id); return(File(blog.Banner, "image/jpeg")); }