Exemplo n.º 1
0
        public static void Initialize(PlayerContext db)
        {
            if (!db.Players.Any())
            {
                db.Players.Add(new Player
                {
                    FirstName = "Bob",
                    LastName = "Doe",
                    Position = "ST"
                });
                db.Players.Add(new Player
                {
                    FirstName = "Ann",
                    LastName = "Lee",
                    Position = "DMF"
                });
                db.Players.Add(new Player
                {
                    FirstName = "Sue",
                    LastName = "Douglas",
                    Position = "MF"
                });
                db.Players.Add(new Player
                {
                    FirstName = "Tom",
                    LastName = "Brown",
                    Position = "Business"
                });
                db.Players.Add(new Player
                {
                    FirstName = "Joe",
                    LastName = "Mason",
                    Position = "MF"
                });

                db.SaveChanges();
            }
        }
Exemplo n.º 2
0
 public PlayersController(PlayerContext context)
 {
     _context = context;
 }