Exemple #1
0
        public void UpdateOrAddStudent(Student student)
        {
            int result = students.RemoveAll(x => x.Id == student.Id);

            students.Add(student);
            XmlService.WriteXml(students);
        }
Exemple #2
0
        public void DeleteStudent(string id)
        {
            int result = students.RemoveAll(x => x.Id == id);

            if (result > 0)
            {
                XmlService.WriteXml(students);
            }
        }
Exemple #3
0
 public Repository()
 {
     students = XmlService.ReadXml <List <Student> >();
 }