public async Task <IActionResult> Index()
        {
            SightingSearchByAirlineViewModel model = new SightingSearchByAirlineViewModel
            {
                PageNumber = 1
            };
            List <Airline> airlines = await _airlines.GetAirlinesAsync();

            model.SetAirlines(airlines);
            return(View(model));
        }
예제 #2
0
        public async Task <IActionResult> Index(int airlineId = 0, string number = "", string embarkation = "", string destination = "")
        {
            // Construct the model and assign the selected manufacturer and aircraft
            // model
            ListFlightsViewModel model = new ListFlightsViewModel();

            model.AirlineId    = airlineId;
            model.FlightNumber = number;
            model.Embarkation  = embarkation;
            model.Destination  = destination;

            // Load the airlines list
            List <Airline> airlines = await _airlines.GetAirlinesAsync();

            model.SetAirlines(airlines);

            return(View(model));
        }
예제 #3
0
 /// <summary>
 /// Return the available airlines
 /// </summary>
 /// <returns></returns>
 public async Task <List <Airline> > GetAirlinesAsync()
 => await _airlines.GetAirlinesAsync();
        public async Task <IActionResult> Index()
        {
            List <Airline> airlines = await _client.GetAirlinesAsync();

            return(View(airlines));
        }