public static Dictionary <string, JObject> ProcessCSVDirectory(DirectoryWrapper csvDirWrapper, DirectoryWrapper jsonDirWrapper) { DirectoryInfo csvDir = csvDirWrapper.CreateInfo(); DirectoryInfo jsonDir = jsonDirWrapper.CreateInfo(); if (!csvDir.Exists) { throw new ArgumentException("Directory does not exist: " + csvDir + "."); } if (!jsonDir.Exists) { throw new ArgumentException("Directory does not exist: " + jsonDir + "."); } Dictionary <string, JObject> processedCsv = new Dictionary <string, JObject>(); foreach (FileInfo csvFile in csvDir.GetFiles()) { FileWrapper csvWrapper = new FileWrapper(csvFile); JObject tableCsv = ProcessCSV(csvWrapper); processedCsv.Add(csvWrapper.FullName, tableCsv); } return(processedCsv); }