public List LoadData(string filename) { Dictionary> trainingData = new Dictionary>(); using (var sr = new StreamReader(filename)) { var reader = new CsvReader(sr); //CSVReader will now read the whole file into an enumerable IEnumerable records = reader.GetRecords(); return records.ToList(); }