title: Flights: find lowest price flight combinations
body: <p>A destination may have 2 connected flights, for example</p>
  
  <p>For Frankfurt to Boston</p>
  
  <p>Frankfurt-London (at 08:00-10:00, 14:00-18:00 etc.) with flight number fl1, fl2  </p>
  
  <p>London-Boston (at 10:00-12:00, 16:00-20:00 etc.) with flight number lb1, lb2  </p>
  
  <p>Each flight may have classes such as A, B  etc. (from cheap to expensive)</p>
  
  <p>I have already Cartesian such as of all combinations:  </p>
  
  <p>fl1/A - lb1/A  (fl1 being flight number / A being class)<br>
  fl1/A - lb1/B<br>
  fl1/B - lb1/A<br>
  fl1/B - lb1/B<br>
  ...<br>
  fl2/B - lb2/B</p>
  
  <p>What should I present at end screen is lowest price flight for each destination combination: </p>
  
  <p>fl1/A - lb1/A<br>
  fl1/A - lb2/A<br>
  fl2/A - lb1/A<br>
  fl2/A - lb2/A  </p>
  
  <p>How can I achieve this with linq query/queries?</p>
  
  <p>What should I do find lowest priced flight for </p>
  
  <hr>
  
  <p>I have Destination and Flight classes:</p>
  
  <pre><code>Class Destination 
  {
      List&lt;Flight&gt; Flights
  }
  </code></pre>
  
  <p>and </p>
  
  <pre><code>Class Flight{
      List&lt;String&gt; @Classes;   //such as A,B,C,D,E  
      String FlightId;       
  }
  </code></pre>
  
  <p>So far I can have flatten list of flights with:</p>
  
  <pre><code>var flights = destination.SelectMany(d=&gt;d.flights);
  </code></pre>
  
  <p>But I cannot figure out how to continue?</p>
  
  <p>Note: I hope I did not make mistake while simplifying my real case</p>
  
  <p>Here is what it looks like my case on html table structure:  </p>
  
  <p><a href="https://i.stack.imgur.com/JpX7p.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JpX7p.png" alt="enter image description here"></a></p>