Esempio n. 1
0
        public void UpdateTeachers(int id)
        {
            SubjectDBContext subContext = new SubjectDBContext();
            var c = (from teach in subContext.Teachers
                     where teach.TeacherID == id
                     select teach).Single();

            c.TeacherID   = 2;
            c.TeacherName = "CSG csg";
            subContext.SaveChanges();
        }
Esempio n. 2
0
        public List <Teacher> GetTeachers()
        {
            SubjectDBContext subContext = new SubjectDBContext();

            return(subContext.Teachers.ToList());
        }