title: Combine tables using row values as column LINQ C# SQL
body: <p>I have a <code>users</code> table:</p>
  
  <pre><code>Id  | Name   | Age
  -------------------- 
  1   | Steve  | 21
  2   | Jack   | 17
  3   | Alice  | 25
  4   | Harry  | 14
  </code></pre>
  
  <p>I also have a table containing additional user info:</p>
  
  <pre><code>UId | Key    | Value
  ---------------------- 
  1   | Height | 70
  2   | Height | 65
  2   | Eyes   | Blue
  4   | Height | 51
  3   | Hair   | Brown
  1   | Eyes   | Green
  </code></pre>
  
  <p>The <code>UId</code> column links to the <code>Id</code> column in the <code>users</code> table. As you can see, not all users have the same additional info present. Alice doesn't have a height value, Jack is the only one with an eye color value etc. </p>
  
  <p>Is there a way to combine this data into one table dynamically using <code>C#</code> and <code>LINQ</code> queries so that the result is something like this: </p>
  
  <pre><code>Id  | Name   | Age | Height | Eyes  | Hair
  ------------------------------------------ 
  1   | Steve  | 21  |   70   | Green |     
  2   | Jack   | 17  |   65   | Blue  |       
  3   | Alice  | 25  |        |       | Brown   
  4   | Harry  | 14  |   51   |
  </code></pre>
  
  <p>If a user does not have a value for the column, it can remain empty/null. Does this require some sort of data pivoting?</p>