public void Remove(Model.Model m) { m.Delete(); switch (m.Table) { case "Educations": Educations.Remove((Education)m); break; case "Students": Students.Remove((Student)m); break; case "Exams": Exams.Remove((Exam)m); break; case "Attempts": Attempts.Remove((Attempt)m); break; } dao.UpdateData(); m.AfterDelete(); }