public static void Initialize(IServiceProvider serviceProvider) { using (var context = new MegaDeskWebApplicationContext( serviceProvider.GetRequiredService <DbContextOptions <MegaDeskWebApplicationContext> >())) { // Look for any quotes. if (context.Quote.Any()) { return; // DB has been seeded } context.SaveChanges(); } }
public DeleteModel(MegaDeskWebApplication.Models.MegaDeskWebApplicationContext context) { _context = context; }
public IndexModel(MegaDeskWebApplication.Models.MegaDeskWebApplicationContext context) { _context = context; }