I have two classes, as follows:
public class Route
{
public ObservableCollection<Flight> Flights = new ObservableCollection<Flight>();
}
public class Flight
{
string airlineName;
}
I wish to return a list of all routes that have a flight that is operated by a specified airline.
I tried doing Routes.SelectMany(x => x.Flights).Where(x => x.Airline == airline);
but that returns all the flight objects - I need the route objects...
Can anyone explain how I can do this using ObjectQuery? Thanks in advance!