コード例 #1
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            await _adminService.AddAdminUserAsync(new AdminUser(Id, FirstName, LastName, "admin", Email, passwordHasher.HashPassword(null, Password)));

            return(RedirectToPage("/Index"));
        }