Пример #1
0
        public async Task SeedAsync()
        {
            if (_options.Value.InMemory)
            {
                await _dataInitializer.InitializeAsync();

                return;
            }

            await _context.Database.EnsureCreatedAsync();

            await _context.Database.MigrateAsync();

            if (await _context.Customers.AnyAsync())
            {
                return;
            }

            await _unitOfWork.ExecuteAsync(() => _dataInitializer.InitializeAsync());
        }
Пример #2
0
 public async Task SeedAsync() => await _dataInitializer.InitializeAsync();