示例#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;
 }