コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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();
        }