public static async Task TransactionInitialize(ITransactionRepository repository) { Random rnd = new Random(); if (!await repository.CheckCount()) { foreach (int ProjectId in Enumerable.Range(1, 3)) { foreach (int Operation in Enumerable.Range(1, 11)) { foreach (int i in Enumerable.Range(1, 2)) { await repository.CreateAsync(new Transaction { ActionDate = DateTime.Now, Description = "Тестовые данные", Sum = rnd.Next(1, 10000), ProjectId = ProjectId, ScoreId = 3, CounterPartyId = 1, UserId = 1, OperationId = Operation }); } } } } }