Cześć. Mam plik SeedData który wypełnia tabelę danymi. Wypełnia też userów. Mój problem polega na tym że chciałbym że przy każdym wypełnieniu tabeli przykładowymi userami. Ci użytkownicy mieli ustawione lockoutEnabled na false. Jak to mogę zrobić robię tak :

 var userMgr = provider.GetRequiredService<UserManager<ApplicationUser>>();
                var alice = userMgr.FindByNameAsync("alice").Result;
                if (alice == null)
                {
                    alice = new ApplicationUser
                    {
                        FirstName = "Alice",
                        LastName = "Smith",
                        Email = "[email protected]",
                        UserName = "alice",
                        EmailConfirmed = true,
                        LockoutEnabled = false
                    };
                    userMgr.SetLockoutEnabledAsync(alice, false);
                    var result = userMgr.CreateAsync(alice, "Pass123$").Result;
                    
                    if (!result.Succeeded)
                    {
                        throw new Exception(result.Errors.First().Description);
                    }

                    alice = userMgr.FindByNameAsync("alice").Result;

                    result = userMgr.AddToRoleAsync(alice, Constants.Roles.User).Result;

                    if (!result.Succeeded)
                    {
                        throw new Exception(result.Errors.First().Description);
                    }

                    result = userMgr.AddClaimsAsync(alice, new Claim[]{
                                new Claim(JwtClaimTypes.Name, alice.UserName),
                                new Claim(JwtClaimTypes.GivenName, "Alice"),
                                new Claim(JwtClaimTypes.FamilyName, "Smith"),
                                new Claim(JwtClaimTypes.Email, "[email protected]"),
                                new Claim(JwtClaimTypes.EmailVerified, "true", ClaimValueTypes.Boolean),
                                new Claim(JwtClaimTypes.WebSite, "http://alice.com"),
                                new Claim(JwtClaimTypes.Address, @"{ 'street_address': 'One Hacker Way', 'locality': 'Heidelberg', 'postal_code': 69118, 'country': 'Germany' }", IdentityServer4.IdentityServerConstants.ClaimValueTypes.Json),
                                new Claim(JwtClaimTypes.Role, Constants.Roles.User)
                            }).Result;
                    if (!result.Succeeded)
                    {
                        throw new Exception(result.Errors.First().Description);
                    }
                    Console.WriteLine("alice created");

używam moetody SetLockoutEnabledAsync oraz przy definicji ale i tak w bazie mam lockoutEnabled na 1 true :(