Beispiel #1
0
        async public Task <IActionResult> Index()
        {
            var aircraftsDto = await aircraftApiService.GetAll();

            var aircraftsViewModel = aircraftsDto.Select(aircraftDto => new AircraftViewModel(aircraftDto));

            return(View(aircraftsViewModel));
        }
        async Task PopulateLists(FlightEditViewModel flightEditViewModel)
        {
            var airportsDto = await airportApiService.GetAll();

            var aircraftsDto = await aircraftApiService.GetAll();

            flightEditViewModel.Airports  = new SelectList(airportsDto.OrderBy(a => a.Name), "Id", "Name");
            flightEditViewModel.Aircrafts = new SelectList(aircraftsDto.OrderBy(a => a.Name), "Id", "Name");
        }