private async Task InsertMenusAsync(DataSeedContext context) { foreach (var menu in MenuDataSeedProvider.Menus) { if (MenuRepository.Any(x => x.DisplayName == menu.DisplayName)) { continue; } await MenuRepository.InsertAsync(menu); } }
private async Task InsertMenusAsync(DataSeedContext context) { foreach (var menu in MenuDataSeedProvider.Menus) { if (MenuRepository.Any(x => x.DisplayName == menu.DisplayName)) { continue; } await MenuRepository.InsertAsync(menu, true); } await UnitOfWorkManager.Current.SaveChangesAsync(); }