private void InitFlights() { Flight flight1 = new Flight(); Flight flight2 = new Flight(); flight1.Id = 1; flight2.Id = 2; flight1.FlightNumber = FlightNumbers.Find(f => f.Airline == "EgyAir"); flight2.FlightNumber = FlightNumbers.Find(f => f.Airline == "USAir"); Flights.Add(flight1); Flights.Add(flight2); FlightNumbers.Find(fn => fn.Airline == "EgyAir").Flights = Flights; FlightNumbers.Find(fn => fn.Airline == "USAir").Flights.Add(flight2); }
private void InitFlightNumbers() { FlightNumber flightNumber1 = new FlightNumber(); FlightNumber flightNumber2 = new FlightNumber(); flightNumber1.Airline = "EgyAir"; flightNumber1.Departure = DateTime.Now; flightNumber1.Description = "New Flight"; flightNumber2.Airline = "USAir"; flightNumber2.Departure = DateTime.Now; flightNumber2.Description = "New Air Flight"; flightNumber1.StartAirport = Airports.Find(p => p.Id == 1); flightNumber1.DestinationAirport = Airports.Find(p => p.Id == 2); flightNumber2.StartAirport = Airports.Find(p => p.Id == 2); flightNumber2.DestinationAirport = Airports.Find(p => p.Id == 1); FlightNumbers.Add(flightNumber1); FlightNumbers.Add(flightNumber2); Airports.Find(a => a.Id == 1).FlightNumbers = FlightNumbers; Airports.Find(a => a.Id == 2).FlightNumbers = FlightNumbers; }