public IActionResult OnGet(int blogId) { blog = blogData.GetById(blogId); if (blog == null) { return(RedirectToPage("./NotFound")); } return(Page()); }
public IActionResult OnGet(int blogId) { Blog = blogData.GetById(blogId); if (Blog == null) { return(RedirectToPage("./NotFound")); } userProfile = accountData.GetById(Blog.userId); return(Page()); }
public IActionResult OnGet(int blogDetailsId) { BlogDetails = _blogData.GetById(blogDetailsId); if (BlogDetails == null) { return(RedirectToPage("./NotFound")); } return(Page()); }
//retrieving id from BlogDetails public IActionResult OnGet(int?blogDetailsId) { BlogDetails = blogDetailsId.HasValue ? _blogData.GetById(blogDetailsId.Value) : new BlogDetails(); //if no id is found if (BlogDetails == null) { return(RedirectToPage("./NotFound")); } return(Page()); }