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;
 }
Example #3
0
 public IndexModel(MegaDeskWebApplication.Models.MegaDeskWebApplicationContext context)
 {
     _context = context;
 }