Exemplo n.º 1
0
        public async Task <ActionResult> GetAirplaneSeatsAsync(int airplaneId)
        {
            BlAirplane airplane = await _airplaneService.GetByIdAsync(airplaneId);

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

            IReadOnlyCollection <BlAirplaneSeat> seatsBl = await _airplaneService.GetAirplaneSeatsAsync(airplaneId);

            IReadOnlyCollection <AirplaneSeat> seats = seatsBl.Select(_mapper.Map <AirplaneSeat>).ToList();

            return(Ok(seats));
        }