public List <Person> Read(string file) { string[] data = File.ReadAllLines(file); var ppl = data.Select(x => CSVStringToPersonConverter.Convert(x)); return(ppl.ToList()); }
public List <Person> Read(string fileName) { StreamReader sr = new StreamReader(fileName); string data = sr.ReadToEnd(); string[] lines = data.Split(new[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries); var ppl = lines.Select(x => CSVStringToPersonConverter.Convert(x)); return(ppl.ToList()); }