public static CommandResponse SeedUsers(int count) { var newUsers = new Seeder().GetSeedUserData(count); newUsers.ForEach(x => x.UserName = x.Email); newUsers.ForEach(x => Console.Write(x.UserName + ", ")); var userStore = new UserStore<User>(Db); var userManager = new UserManager<User>(userStore); foreach ( var newUser in newUsers.Where(newUser => !Db.Users.Any(x => x.UserName == newUser.UserName))) { userManager.Create(newUser, "Password@123"); } return CommandResponse.Success; }
public static CommandResponse SeedBands(int count) { Console.WriteLine($"Seeding {count} bands..."); var bandNames = new Seeder().GetSeedBandNames(count); bandNames.ForEach(x => Db.Bands.Add(new Band { Name = x })); Db.SaveChanges(); return CommandResponse.Success; }