Beispiel #1
0
        private async Task SuperAdminEnsureCreate(string email, AppUser user = null)
        {
            var isNayUser = await _userManager.Users.Where(i => i.Email != email).AnyAsync();

            if (!isNayUser)
            {
                await DbInit.InitialRoles(_configuration, _roleManager);

                var _user = user ?? await _userManager.FindByEmailAsync(email);

                await _userManager.AddToRolesAsync(_user, _configuration.GetRoles());
            }
        }