public static void Initialize(IServiceProvider serviceProvider) { using (var context = new MvcSpicyoContext( serviceProvider.GetRequiredService < DbContextOptions <MvcSpicyoContext> >())) { // Look for any movies. if (context.Spicyo.Any()) { return; // DB has been seeded } context.SaveChanges(); } }
public SpicyoController(MvcSpicyoContext context) { _context = context; }