Example #1
0
        public ActionResult <IList <Department> > GetAllDepartments()
        {
            if (_classroomService == null)
            {
                return(NotFound());
            }

            return(_classroomService.GetAllDepartments().ToList());
        }
Example #2
0
        public IEnumerable <Department> GetAllDepartments()
        {
            var departments = _repository.GetAllDepartments();

            foreach (Department department in departments)
            {
                yield return(department);
            }
        }