Esempio n. 1
0
        public async Task <ActionResult <IEnumerable <ClassRoomDto> > > GetClassRooms([FromQuery] ClassDtoParameter classDtoParameter)
        {
            var ClassRooms = await _classRoomRepository.GetClassRoomsAsync(classDtoParameter);

            var ClassRoomDto = _Mapper.Map <IEnumerable <ClassRoomDto> >(ClassRooms);

            return(Ok(ClassRoomDto));
        }
Esempio n. 2
0
        public async Task <IActionResult> GetClassCollections([FromRoute]
                                                              [ModelBinder(BinderType = typeof(ArrayModelBinder))]
                                                              IEnumerable <Guid> guids)
        {
            if (guids == null)
            {
                return(BadRequest());
            }
            var Enitites = await _classRoom.GetClassRoomsAsync(guids);

            if (guids.Count() != Enitites.Count())
            {
                return(NotFound());
            }
            var dtoToTurn = _mapper.Map <IEnumerable <ClassRoomDto> >(Enitites);

            return(Ok(dtoToTurn));
        }