Example #1
0
 private void CheckSubject(SchoolSubject sc)
 {
     if (sc == null)
     {
         throw new ArgumentNullException("Nauczyciel musi uczyć minimum jednego przedmiotu");
     }
 }
Example #2
0
 public Teacher(SchoolSubject sc)
 {
     CheckSubject(sc);
     _subjects = new HashSet <SchoolSubject> {
         sc
     };
 }
Example #3
0
 public bool Remove(string subjectName)
 {
     try
     {
         SchoolSubject subject = _subjects.Single(x => x.Name.Equals(subjectName));
         _subjects.Remove(subject);
         return(true);
     }
     catch (System.InvalidOperationException)
     {
         return(false);
     }
 }
Example #4
0
 public bool Add(SchoolSubject subject)
 {
     return(_subjects.Add(subject));
 }