public async Task <IActionResult> OnGetAsync(int id) { Role = await _context.GetRoleAsync(id); if (Role == null) { TempData["Message"] = $"Role not found. Id = {id}."; return(RedirectToPage("./Index")); } return(Page()); }
public async Task <IActionResult> OnGetAsync(int id) { var role = await _context.GetRoleAsync(id); if (role == null) { TempData["Message"] = $"Role not found. Id = {id}."; return(RedirectToPage("./Index")); } Role = new EditRoleModel { Name = role.Name }; return(Page()); }