Пример #1
0
        public static void Initialize(PacmanWebbContext context)
        {
            //context.Database.EnsureCreated();

            // Look for any students.
            if (context.PlayerModel.Any())
            {
                return;   // DB has been seeded
            }

            var players = new PlayerModel[]
            {
                new PlayerModel {
                    Name = "Bo", Score = 124
                },
                new PlayerModel {
                    Name = "Burnham", Score = 544
                },
                new PlayerModel {
                    Name = "Louis", Score = 123
                },
                new PlayerModel {
                    Name = "Ck", Score = 120
                },
                new PlayerModel {
                    Name = "George", Score = 120
                },
                new PlayerModel {
                    Name = "Carlin", Score = 223
                },
                new PlayerModel {
                    Name = "Michael", Score = 120
                },
                new PlayerModel {
                    Name = "Hirst", Score = 435
                }
            };

            foreach (PlayerModel pl in players)
            {
                context.PlayerModel.Add(pl);
            }
            context.SaveChanges();
        }
 public IndexModel(PacmanWebb.Models.PacmanWebbContext context)
 {
     _context = context;
 }
Пример #3
0
 public CreateModel(PacmanWebb.Models.PacmanWebbContext context)
 {
     _context = context;
 }
Пример #4
0
 public DetailsModel(PacmanWebb.Models.PacmanWebbContext context)
 {
     _context = context;
 }
Пример #5
0
 public EditModel(PacmanWebb.Models.PacmanWebbContext context)
 {
     _context = context;
 }
Пример #6
0
 public DeleteModel(PacmanWebb.Models.PacmanWebbContext context)
 {
     _context = context;
 }