public async Task <IActionResult> OnGetAsync(Guid postId) { PostList = await postService.GetPosts(); SpecificPost = await postService.GetSepecificPost(postId); CategoryName = await cateService.GetCategoryName(SpecificPost.CategoryId); return(Page()); }
public async Task <IActionResult> OnGetAsync(Guid cateId) { var result = await authorization.IsGrantedAsync(blogPermissions.Category.CreateCategory); if (result) { SpecificCategoryDto.Name = await categoryService.GetCategoryName(cateId); SpecificCategoryDto.Id = cateId; return(Page()); } else { return(RedirectToPage("/Error/AccessDenied", new { errorMesseage = "You don't have permission of Update Category!" })); } }