title: Linq Select specific properties from list to 2d array
body: <p>I have list of objects that i want to export to excel:</p>
  
  <pre><code>//My export to excel function:
  public static void ExportToExcel(string[,] data, string excelFilePath = null)
  {
    // .....
  }
  </code></pre>
  
  <p>My list contains many columns so i would like to select specific columns and add them into 2d array, also add the header on the top</p>
  
  <p>public class Student</p>
  
  <pre><code>{
      public int Id { get; set; }
      public string Name { get; set; }
      public int Age { get; set; }
      public Address Adress { get; set; }
      public Evaluation Evaluation { get; set; }
      // ... many more
  }
  </code></pre>
  
  <p>List:</p>
  
  <pre><code>&gt;   IEnumerable&lt;Student&gt; students
  </code></pre>
  
  <p>Fields to be selected:</p>
  
  <ol>
  <li>Id</li>
  <li>Name</li>
  <li>Address.Zipcode</li>
  </ol>
  
  <p>I can perform this with for loop however i'm interested in linq, also i would like to hear your advice about performance since the list has + 200k records </p>
  
  <p><strong>Edit</strong>
  Sample</p>
  
  <blockquote>
    <p>Columns => ID Name Zipcode</p>
    
    <p>Rows => values</p>
  </blockquote>
  
  <pre><code>ID Name Zip
  1  Mike 1101 
  2  Jan  2250
  3  Peter 4456
  </code></pre>