public static async void Initialize(IServiceProvider serviceProvider) { using var context = new MenuDishContext( serviceProvider.GetRequiredService < DbContextOptions <MenuDishContext> >()); // Look for any movies. if (context.MenuDish.Any()) { return; // DB has been seeded } else { await ReadHTML(); foreach (var item in MenuList) { context.MenuDish.Add(item); context.SaveChanges(); } } }
public HomeController(ILogger <HomeController> logger, IngredientContext context, MenuDishContext contextMenu) { _logger = logger; _context = context; _contextMenu = contextMenu; }
public MenuDishesController(MenuDishContext context) { _context = context; }