示例#1
0
        public async Task <IEnumerable <Flight> > GetAllFlights(DateTime relativeTo)
        {
            // get the server list from the server model
            List <Server> externalServers = (List <Server>)serverModel.GetAllExternalServers();
            // creating the list of all flights
            List <Flight> serversFlightsList = new List <Flight>();

            // get the flights list from each server in the servers list
            foreach (Server server in externalServers)
            {
                // get the flights from the server
                List <Flight> serverFlights = (List <Flight>) await
                                              GetOuterFlights(server, relativeTo);

                // adding thos flights to our list
                serversFlightsList.AddRange(serverFlights);
            }

            // get all our internal flights
            List <Flight> internalFlightsList = (List <Flight>) await
                                                GetAllInternalFlights(relativeTo);

            // adding our internal flight to the list of all flights
            serversFlightsList.AddRange(internalFlightsList);

            return(serversFlightsList);
        }