Example #1
0
        public async Task <IActionResult> Edit(int id)
        {
            Flight flight = await _flights.GetFlightByIdAsync(id);

            EditFlightViewModel model    = _mapper.Map <EditFlightViewModel>(flight);
            List <Airline>      airlines = await _airlines.GetAirlinesAsync();

            model.SetAirlines(airlines);
            return(View(model));
        }
Example #2
0
 /// <summary>
 /// Return the details of the flight with the specified Id
 /// </summary>
 /// <param name="flightId"></param>
 /// <returns></returns>
 public async Task <Flight> GetFlightAsync(int flightId)
 => await _flights.GetFlightByIdAsync(flightId);