public Task HandleAsync(DepartmentProfessor message, CancellationToken cancellationToken)
        {
            DepartmentProfessor = message;
            Department.Id       = message.DepartmentId;
            Department.Name     = message.Name;
            Department.Code     = message.Code;
            Name = message.Name;
            Code = message.Code;
            var prof = _professorRepository.GetProfessors();

            Professors.AddRange(prof);
            Id = message.ProfessorId;
            if (Professors.Count != 0)
            {
                Professor = Professors.Where(p => p.Id == message.ProfessorId).First();
            }
            return(Task.CompletedTask);
        }
        public SearchFilter ApplyFilter()
        {
            if (CityName == "" && FacultyName == "" && ProfessorName == "" && MinReview == 0 && MaxReview == Int16.MaxValue)
            {
                return(this);
            }

            if (CityName != "")
            {
                Cities    = Cities.Where(city => city.Name.ToLower().Contains(CityName.ToLower()));
                Faculties = Cities.SelectMany(c => c.Universities).SelectMany(u => u.Faculties);
                Subjects  = Subjects.Where(s => Faculties.Contains(s.Faculty));
                var professors = Subjects.SelectMany(s => s.Professors).Select(s => s.Professor);
                Professors = Professors.Where(p => professors.Contains(p));
            }
            if (FacultyName != "")
            {
                Faculties = Faculties.Where(faculty => faculty.Name.ToLower().Contains(FacultyName.ToLower()));
                Subjects  = Subjects.Where(s => Faculties.Contains(s.Faculty));
                var professors = Subjects.SelectMany(s => s.Professors).Select(s => s.Professor);
                Professors = Professors.Where(p => professors.Contains(p));
            }
            if (ProfessorName != "")
            {
                Professors = Professors.Where(professor => professor.FullName.ToLower().Contains(ProfessorName.ToLower()));
                var subjects = Professors.SelectMany(p => p.Subjects).Select(p => p.Subject);
                Subjects = Subjects.Where(s => subjects.Contains(s));
            }
            if (MinReview.HasValue)
            {
                Professors = Professors.Where(professor => professor.Reviews.Count >= MinReview);
                Subjects   = Subjects.Where(subject => subject.Reviews.Count >= MinReview);
            }
            if (MaxReview.HasValue)
            {
                Professors = Professors.Where(professor => professor.Reviews.Count <= MaxReview);
                Subjects   = Subjects.Where(subject => subject.Reviews.Count <= MaxReview);
            }
            return(this);
        }