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(); }
public CreateModel(HungryBirds.Models.PupilContext context) { _context = context; }
public EditModel(HungryBirds.Models.PupilContext context) { _context = context; }
public IndexModel(HungryBirds.Models.PupilContext context) { _context = context; }
public DetailsModel(HungryBirds.Models.PupilContext context) { _context = context; }