Example #1
0
 public static void Initialize(IServiceProvider serviceProvider)
 {
     using (var context = new SmartAspContext(
                serviceProvider.GetRequiredService <
                    DbContextOptions <SmartAspContext> >()))
     {
         // Look for any movies.
         if (context.Product.Any())
         {
             return;   // DB has been seeded
         }
     }
 }
Example #2
0
 public BrandsController(SmartAspContext context)
 {
     _context = context;
 }
 public ProductsController(SmartAspContext context)
 {
     _context = context;
 }
Example #4
0
 public DepartmentsController(SmartAspContext context)
 {
     _context = context;
 }