Beispiel #1
0
        public async Task OnGetAsync(string returnUrl = null)
        {
            if (!await _roleManager.RoleExistsAsync("Admin"))
            {
                await _roleManager.CreateAsync(new IdentityRole("Admin"));

                await _roleManager.CreateAsync(new IdentityRole("Customer"));
            }
            ViewData["listOptions"] = new SelectList(_logicClass.GetLocations(), "LocationId", "LocationName");
            ReturnUrl      = returnUrl;
            ExternalLogins = (await _signInManager.GetExternalAuthenticationSchemesAsync()).ToList();
        }
Beispiel #2
0
        public async Task <IActionResult> OnGetAsync()
        {
            var user = await _userManager.GetUserAsync(User);

            if (user == null)
            {
                return(NotFound($"Unable to load user with ID '{_userManager.GetUserId(User)}'."));
            }
            ViewData["listOptions"] = new SelectList(_logicClass.GetLocations(), "LocationId", "LocationName");
            await LoadAsync(user);

            return(Page());
        }