public CsvObservationUploader(Configuration configuration, ILogger logger, MushroomObserverApiService apiService)
 {
     Configuration = configuration;
     ApiService = apiService;
     Logger = logger;
     ImageDirectoryInfo = new DirectoryInfo(configuration.ImageDirectory);
     using (var reader = File.OpenText(configuration.ObservationCsvFile))
     {
         var csv = new CsvReader(reader);
         RecordsToUpload = csv.GetRecords<NAMASpreadsheet>().ToList().Where(r => GetImagePaths(r.RecordNumber).Any()).ToList();
     }
 }
        private void Run(Configuration configuration)
        {
            #if DEBUG
            var url = "http://localhost:3000/api";
            #else
            var url = "http://mushroomobserver.org/api";
            #endif

            var apiService = new MushroomObserverApiService(new Uri(url), ApiKey);
            var logger = new FileLogger(configuration.LogFile);
            var uploader = new CsvObservationUploader(configuration, logger, apiService);
            logger.Log($"Starting upload for {configuration.ObservationCsvFile}");
            uploader.Run();
        }