Esempio n. 1
0
        public List <Person> ReadPeople(string fileName)
        {
            string[] allData = File.ReadAllLines(fileName);
            var      people  = allData.Select(x => CSVStringToPersonConverter.Convert(x));

            return(people.ToList());
        }
Esempio n. 2
0
        public List <Person> ReadPeople(string fileName)
        {
            string data;

            using (var reader = new StreamReader(fileName))
            {
                data = reader.ReadToEnd();
            }
            string[] lines  = data.Split(new[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);
            var      people = lines.Select(x => CSVStringToPersonConverter.Convert(x));

            return(people.ToList());
        }