title: EPPlus - Read Excel Table
body: <p>Using EPPlus, I want to read an excel table, then store all the contents from each column into its corresponding <code>List</code>. I want it to recognize the table's heading and categorize the contents based on that.</p>
  
  <p>For example, if my excel table is as below:</p>
  
  <pre><code>Id    Name     Gender
   1    John     Male
   2    Maria    Female
   3    Daniel   Unknown
  </code></pre>
  
  <p>I want the data to store in <code>List&lt;ExcelData&gt;</code> where</p>
  
  <pre><code>public class ExcelData
  {
      public string Id { get; set; }
      public string Name { get; set; }
      public string Gender { get; set; }
  }
  </code></pre>
  
  <p>So that I can call out the contents using the heading name. For example, when I do this:</p>
  
  <pre><code>foreach (var data in ThatList)
  {
       Console.WriteLine(data.Id + data.Name + data.Gender);
  }
  </code></pre>
  
  <p>It will give me this output:</p>
  
  <pre><code>1JohnMale
  2MariaFemale
  3DanielUnknown
  </code></pre>
  
  <hr>
  
  <p>This is really all I got:</p>
  
  <pre><code>var package = new ExcelPackage(new FileInfo(@"C:\ExcelFile.xlsx"));
  ExcelWorksheet sheet = package.Workbook.Worksheets[1];
  
  var table = sheet.Tables.First();
  
  table.Columns.Something //I guess I can use this to do what I want
  </code></pre>
  
  <p>Please help :(
  I have spent long hours searching for sample code regarding this so that I can learn from it but to no avail. I also understand ExcelToLinQ is managed to do that but it can't recognize table.</p>