public IEnumerable <MajorViewModel> GetAllMajors()
        {
            var allMajors = new List <MajorViewModel>();

            foreach (var major in _repository.GetAllMajors())
            {
                allMajors.Add(MapToMajorViewModel(major));
            }
            return(allMajors);
        }
Beispiel #2
0
        public async Task <IEnumerable <MajorResource> > GetAllMajors()
        {
            var majors = await repository.GetAllMajors();

            return(mapper.Map <IEnumerable <Major>, IEnumerable <MajorResource> >(majors));
        }
        public IActionResult GetAll()
        {
            var majors = _majorRepository.GetAllMajors();

            return(Ok(majors));
        }