private async void InitializeAsync() { var isThereBanks = await _marketingDbContext.Banks.AnyAsync(); if (isThereBanks) { return; } for (int i = 100000001; i <= 100002000; i++) { var app = new Bank { Bic = i.ToString(), Name = $"Банк {i - 100000000}", RecordDate = DateTime.Now }; await _marketingDbContext.AddAsync(app); } await _marketingDbContext.SaveChangesAsync(); }
private async void InitializeAsync() { var isThereApps = await _marketingDbContext.Applications.AnyAsync(); if (isThereApps) { return; } for (var i = 1; i <= 1000; i++) { var app = new Application { Code = $"AP-{i}", Name = $"Приложение {i}", RecordDate = DateTime.Now }; await _marketingDbContext.AddAsync(app); } await _marketingDbContext.SaveChangesAsync(); }