private void SeedRoles(KitKareDbContext context) { if (context.Roles.Any()) { return; } context.Roles.AddOrUpdate(x => x.Name, new IdentityRole("Admin")); context.SaveChanges(); }
private void SeedAdmin(KitKareDbContext context) { var admin = new User { Email = "*****@*****.**", UserName = "******" }; this.userManager.Create(admin, "admin11"); this.userManager.AddToRole(admin.Id, "Admin"); context.SaveChanges(); }
private void SeedRegularUsers(KitKareDbContext context) { for (int i = 0; i < 10; i++) { var user = new User { Email = "*****@*****.**", UserName = "******" + i }; this.userManager.Create(user, "user11"); seededUsersIds.Add(user.Id); } context.SaveChanges(); }