public static void InitializeDatabase(DSCContext context) { if (!context.Jobs.Any()) { context.Jobs.AddRange(SeedData.Jobs()); context.SaveChanges(); } }
private void dSCDebugToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.Title = "Select a PAL File"; ofd.Filter = "PAL files (*.pal)|*.pal|All files (*.*)|*.*"; ofd.Multiselect = false; if (ofd.ShowDialog() == DialogResult.OK) { DSCContext ctx = new DSCContext(File.ReadAllBytes(ofd.FileName)); } }
public JobRepository(DSCContext context) { _context = context; DSCContextFactory.InitializeDatabase(_context); }