Пример #1
0
        public List <Person> ReadPeople(string filename)
        {
            string[] allData = File.ReadAllLines(filename);
            var      people  = allData.Select(x =>

                                              CSVStringToPersonConverter.Convert(x)
                                              );

            return(people.ToList());
        }
        public List <Person> ReadPeople(string filename)
        {
            using var reader = new StreamReader(filename);
            string data = reader.ReadToEnd();

            string[] lines = data.Split(new[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);

            var people = lines.Select(x => CSVStringToPersonConverter.Convert(x));

            return(people.ToList());
        }