Example #1
0
        public async Task <ActionResult> GetAirplaneSeatTypesAsync(int airplaneId)
        {
            BlAirplane airplane = await _airplaneService.GetByIdAsync(airplaneId);

            if (airplane == null)
            {
                return(NotFound());
            }

            IReadOnlyCollection <BlAirplaneSeatType> seatTypesBl =
                await _airplaneService.GetAirplaneSeatTypesAsync(airplaneId);

            IEnumerable <AirplaneSeatType> seatTypes = seatTypesBl.Select(_mapper.Map <AirplaneSeatType>);

            return(Ok(seatTypes));
        }