title: Using cross-join / pivot with Linq
body: <p>I have a collection with the following structure.</p>
  
  <pre><code>List&lt;QuestionAnswer&gt; answers = new List&lt;QuestionAnswer&gt;(){};
  
  class QuestionAnswer
  {
    string Question { get; set; }
    string Answer { get; set; }
  }
  </code></pre>
  
  <p>It is populated with the following data:</p>
  
  <pre><code>Question Answer
  Q1       a
  Q1       b
  Q2       c
  Q2       d
  Q2       e
  </code></pre>
  
  <p>I need to convert it to the following format:</p>
  
  <pre><code>Q1   Q2
   a   c
   a   d
   a   e
   b   c
   b   d
   b   e
  </code></pre>
  
  <p>The Questions are not known until run-time; there may be n number of Questions in the collection. I believe I need to CROSS JOIN the collection on itself and somehow display questions as headers (pivot rows and columns). I was not able to produce the target data format. Any help is appreciated. </p>