예제 #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();
        }
예제 #2
0
 public CreateModel(HungryBirds.Models.PupilContext context)
 {
     _context = context;
 }
예제 #3
0
 public EditModel(HungryBirds.Models.PupilContext context)
 {
     _context = context;
 }
예제 #4
0
 public IndexModel(HungryBirds.Models.PupilContext context)
 {
     _context = context;
 }
예제 #5
0
 public DetailsModel(HungryBirds.Models.PupilContext context)
 {
     _context = context;
 }