Beispiel #1
0
 public List <Student> GetStudentByTeacherId(int teacherId)
 {
     using FineArtsContext context = new FineArtsContext();
     return((from s in context.Students
             where s.TeacherId == teacherId
             select s).ToList());
 }
Beispiel #2
0
 public List <Teacher> GetTeachers()
 {
     using FineArtsContext context = new FineArtsContext();
     return(context.Teachers.ToList());
 }
Beispiel #3
0
 public bool AddTeachers(Teacher[] teachers)
 {
     using FineArtsContext context = new FineArtsContext();
     context.Teachers.AddRange(teachers);
     return(context.SaveChanges() > 0);
 }
Beispiel #4
0
 public bool HasTeaches()
 {
     //new short way
     using FineArtsContext context = new FineArtsContext();
     return(context.Teachers.Any());
 }