using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using domain.Request; using Presence.Desktop.Models; namespace Presence.Desktop.Helpers { public static class CsvHelper { public static IEnumerable ReadCsvStudents(string path) { List students = new List(); var csvLines = File.ReadAllLines(path, Encoding.GetEncoding("utf-8")); using (var reader = new StreamReader(path)) { string line; while ((line = reader.ReadLine()) != null) { var values = line.Split(';'); if (values.Length != 3) continue; students.Add(new AddStudentRequest { LastName = values[0], FirstName = values[1], Patronymic = values[2] }); } } return students; } } }