Exemple #1
0
        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());
        }
Exemple #2
0
        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());
        }