Beispiel #1
0
        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();
        }
Beispiel #2
0
 public modelDbRepository(ModelDbContext context)
 {
     _context = context;
 }
Beispiel #3
0
 public DataSeeder(ModelDbContext context, UserManager <ApplicationUser> userManager)
 {
     _context     = context;
     _userManager = userManager;
 }