public void Delete(int id)
        {
            Teacher t = context.Teachers.FirstOrDefault(s => s.Id == id);

            if (t != null)
            {
                context.Teachers.Remove(t);
                context.SaveChanges();
            }
        }
Esempio n. 2
0
        public void Delete(int id)
        {
            Student s = context.Students.FirstOrDefault(s => s.Id == id);

            if (s != null)
            {
                context.Students.Remove(s);
                context.SaveChanges();
            }
        }
Esempio n. 3
0
 public void Delete(StudentCourse studentCourse)
 {
     context.StudentCourse.Remove(studentCourse);
     context.SaveChanges();
 }