title: How can I have an optional header row when reading a CSV file?
body: <p>I need to import a CSV file that may or may not have a header record.</p>
  
  <p>If I read a file that doesn't have a header row it assumes the first data row is the header and doesn't return it. 
  If I specify HasHeaderRecord = false it will throw an exception when there is a header record.</p>
  
  <p>Is there a way to use the CsvHelper library and have an optional header record?</p>
  
  <p>I can get this to work using this approach, but it seems like there could be a better way:</p>
  
  <pre><code>csvReader.Configuration.HasHeaderRecord = false;
  
  while (csvReader.Read())
  {
      try
      {
          var record = csvReader.GetRecord&lt;MyModel&gt;();
          myRecordList.Add(record);
      }
      catch (ReaderException rex)
      {
          // Check if this is an error with no header record and ignore
          if (rex.ReadingContext.CurrentIndex == 1 &amp;&amp;
              rex.ReadingContext.RawRecord.ToLower().Contains("myHeaderColumnName"))
          {
              continue;
          }
      }
  }
  </code></pre>