Example #1
0
 public async Task <List <Section> > Sections() => (await _sectionRepository.GetAllAsync()).ToList();
Example #2
0
        public async Task <IActionResult> Index()
        {
            var items = await _sectionRepository.GetAllAsync();

            return(Ok(items));
        }
Example #3
0
        public async Task <IEnumerable <SectionDTO> > GetAllAsync()
        {
            var sections = await _repository.GetAllAsync();

            return(_mapper.Map <IEnumerable <SectionDTO> >(sections));
        }
        public async Task <ActionResult <IEnumerable <GetSectionNameViewModel> > > GetSectionsNames()
        {
            var sections = await sectionRepository.GetAllAsync();

            return(Ok(sections.Select(s => new GetSectionNameViewModel(s))));
        }