protected override void Seed(OplContext context) { List <WorkHour> WorkHours = new List <WorkHour>() { new WorkHour() { Name = "Pierwsza zmiana", StartHour = 7, StopHour = 14, } }; WorkHours.ForEach(x => context.WorkHours.AddOrUpdate(x)); context.SaveChanges(); List <Doctor> Doctors = new List <Doctor>() { new Doctor() { UserName = "******", Name = "Damian", Surname = "Szymański", ContactData = "Lepiej się nie kontaktować", OfficeNumber = 12, WorkHourId = 1, } }; Doctors.ForEach(x => context.Doctors.AddOrUpdate(x)); context.SaveChanges(); }
public BaseController() { context = new OplContext(); }