Пример #1
0
 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;
 }
Пример #3
0
 public IndexModel(MegaDeskWebApplication.Models.MegaDeskWebApplicationContext context)
 {
     _context = context;
 }