public static void Initialize(ModelDbContext context) { if (context.Factions.Any()) { return; } var Factions = new Faction[] { new Faction { Name = "Cryx", }, new Faction { Name = "Cygnar" }, new Faction { Name = "Ret" }, new Faction { Name = "Convergence" }, new Faction { Name = "Menoth" }, new Faction { Name = "Khador" }, new Faction { Name = "Mercs" }, new Faction { Name = "Trolls" }, new Faction { Name = "Skorne" }, new Faction { Name = "Circle" }, new Faction { Name = "Legion" }, new Faction { Name = "Minions" }, }; foreach (var faction in Factions) { context.Factions.Add(faction); } context.SaveChanges(); }
public modelDbRepository(ModelDbContext context) { _context = context; }
public DataSeeder(ModelDbContext context, UserManager <ApplicationUser> userManager) { _context = context; _userManager = userManager; }