public void UpdateSubject(SubjectDTO subjectDTO)
 {
     try
     {
         var subject = context.Subjects.Where(x => x.Id == subjectDTO.Id).FirstOrDefault();
         subject.SubjectTeachers.Clear();
         if (subjectDTO.SelectedTeachers != null)
         {
             foreach (var teacherId in subjectDTO.SelectedTeachers)
             {
                 /*Mapper.Map<Subject>(subjectDTO);*/
                 //var teacher = Mapper.Map<Teacher>(teacherId);
                 var subjectTeacher = new Linq_Subject_Teacher()
                 {
                     SubjectID = subject.Id,
                     TeacherID = teacherId
                 };
                 context.Subject_Teachers.Add(subjectTeacher);
             }
         }
         SaveChanges();
     }
     catch (Exception e)
     {
         throw;
     }
 }
 public void AddSubject(SubjectDTO subjectDTO)
 {
     try
     {
         var subject = new Subject()
         {
             Name = subjectDTO.Name,
         };
         context.Subjects.Add(subject);
         SaveChanges();
         foreach (var teacherId in subjectDTO.SelectedTeachers)
         {
             /*Mapper.Map<Subject>(subjectDTO);*/
             //var teacher = Mapper.Map<Teacher>(teacherId);
             var subjectTeacher = new Linq_Subject_Teacher()
             {
                 SubjectID = subject.Id,
                 TeacherID = teacherId
             };
             context.Subject_Teachers.Add(subjectTeacher);
         }
         SaveChanges();
     }
     catch (Exception)
     {
         throw;
     }
 }