public void UpdateLists() { Educations.Clear(); Students.Clear(); Exams.Clear(); Attempts.Clear(); foreach (DataRow dr in dao.Data.Tables["Educations"].Rows) { Education e = new Education(dr); Educations.Add(e); Students.AddRange(e.Students); Exams.AddRange(e.Exams); } foreach (DataRow dr in dao.Data.Tables["Attempts"].Rows) { Student s = (from stud in Students where stud.ID == (int)dr["student_id"] select stud).First(); Exam e = (from ex in Exams where ex.ID == (int)dr["exam_id"] select ex).First(); Attempts.Add(new Attempt(dr, e, s)); } }
public void AddExams(Examination[] examList) { Exams.AddRange(examList); }
// Methods public void AddExams(params Exam[] exams) => Exams.AddRange(exams);