예제 #1
0
        public List <Person> Read(string file)
        {
            string[] data = File.ReadAllLines(file);
            var      ppl  = data.Select(x => CSVStringToPersonConverter.Convert(x));

            return(ppl.ToList());
        }
예제 #2
0
        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());
        }