Esempio n. 1
0
        public static void Initialize(PupilContext context)
        {
            //context.Database.EnsureCreated();

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

            var students = new Student[]
            {
                new Student {
                    FirstMidName = "Carson", LastName = "Alexander", DateOfBirth = "May", School = "Bucks", YearGroup = "Three", Class = "Miss Smith", Allergies = "Gluten"
                },
                new Student {
                    FirstMidName = "Carson", LastName = "Alexander", DateOfBirth = "May", School = "Bucks", YearGroup = "Three", Class = "Miss Smith", Allergies = "Gluten"
                },
            };

            foreach (Student s in students)
            {
                context.Student.Add(s);
            }
            context.SaveChanges();
        }
Esempio n. 2
0
 public CreateModel(HungryBirds.Models.PupilContext context)
 {
     _context = context;
 }
Esempio n. 3
0
 public EditModel(HungryBirds.Models.PupilContext context)
 {
     _context = context;
 }
Esempio n. 4
0
 public IndexModel(HungryBirds.Models.PupilContext context)
 {
     _context = context;
 }
Esempio n. 5
0
 public DetailsModel(HungryBirds.Models.PupilContext context)
 {
     _context = context;
 }