public void Run() { _logger.LogInformation($"This is a console application"); var startDate = new DateTime(2017, 10, 16); var endDate = new DateTime(2017, 10, 29); var stocks = _stockRepo.GetAllStocks(); foreach (var stock in stocks) { var tDate = startDate; while (tDate <= endDate) { var transactions = _stockLoader.LoadTransactions(stock, tDate, tDate); _transactionRepo.SaveTransactions(transactions); tDate = tDate.AddDays(1); } } _logger.LogInformation($"Done"); System.Console.ReadKey(); }