private async Task RunJobAsync(CancellationToken stoppingToken) { var recordsToProcess = await _syncRepository.GetNextRecordsToProcessAsync(); _logger.LogInformation($"Found {recordsToProcess.Items.Count} record(s) to process."); foreach (var syncJob in recordsToProcess.Items) { var syncJobCompositeModel = await _syncJobCompositeModelFactory.MakeSyncJobCompositeModelAsync(syncJob); await _syncJobFacade.ProcessSyncJob(syncJobCompositeModel); } }