title: How to combine multiple lists of same or different lengths in Linq?
body: <p>I would like to build a method or extension method <strong>that takes multiple lists</strong> and combines them in the following way:</p>
  
  <p>Lets say i have two lists:</p>
  
  <pre><code>        int[] list1 =  {3, 1, 2};
          int[] list2 =  {5, 4 };
  </code></pre>
  
  <p>I would expect a list of arrays as a result like this:</p>
  
  <pre><code>[1,4]
  [1,5]
  [2,4]
  [2,5]
  [3,4]
  [3,5]
  </code></pre>
  
  <p>The number of columns in my resulting list of arrays would be determined by the amount
  of lists passed and both columns need to be sorted.
  The number of rows is just the (length of list A) * (length of list B) * (length of list N)</p>
  
  <p>In this example is 3 * 2 = 6 rows. 2 columns (because 2 input lists).</p>
  
  <p>What would be an elegant way of doing this with linq?</p>
  
  <p>Thanks!</p>