title: CSV to C# FileHelpers
body: <p>I want to use <code>FileHelpers</code> to read an extremely basic <code>CSV</code> file into C#.</p>
  <p>I have a <code>Model</code> that looks like this;</p>
  <pre><code>[DelimitedRecord(&quot;,&quot;)]
  [IgnoreFirst()]
  public class NavigationButton
  {
      public int ID;
      public string Text;
      public string Path;
  }
  </code></pre>
  <p>The <code>CSV</code> file looks like this;</p>
  <p><a href="https://i.stack.imgur.com/jW1Ru.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jW1Ru.jpg" alt="enter image description here" /></a></p>
  <p>I want to be able to read the appropriate lines and create a new <code>NavigationButton</code> for each record read in from the <code>CSV</code> file. I have read them into a <code>DataTable</code> using;</p>
  <pre><code>public DataTable GetNavigationButtonNames()
  {
      var filename = @&quot;C:\Desktop\NavigationButtons.csv&quot;;
      var engine = new FileHelperEngine(typeof(NavigationButton));
      return engine.ReadFileAsDT(filename);
  }
  </code></pre>
  <p>but I now cannot loop through the <code>DataTable</code> as it doesn't implement <code>IEnumerable</code>. I would have created a new <code>NavigationButton</code> in a <code>foreach</code> loop and added in the appropriate rows, however this cannot be done the way I have started out.</p>
  <p>How can I change this method so that I can loop through the object I read into from the <code>CSV</code> file and create a new button for each row in the <code>CSV</code> file?</p>