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

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

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