title: CsvHelper ignore not working
body: <p>I am using <code>CsvHelper</code> to generate a csv file based on a <code>List</code>, but I would like to avoid writing one of the values. As per the <a href="http://joshclose.github.io/CsvHelper/" rel="noreferrer">documentation</a>, I used a <code>CsvClassMap</code> to specify the field that I want to ignore. However, the value is still being written to the file.</p>
  
  <p>Here is my class:</p>
  
  <pre><code>public class Person
  {
      public int Id { get; set; }
      public string FirstName { get; set; }
      public string MiddleName { get; set; }
      public string LastName { get; set; }
  }
  </code></pre>
  
  <p>Here is my <code>CsvClassMap</code>:</p>
  
  <pre><code>public sealed class PersonClassMap : CsvClassMap&lt;Person&gt;
  {
      public PersonClassMap()
      {
          Map(m =&gt; m.Id).Index(0).Name("Id");
          Map(m =&gt; m.FirstName).Index(1).Name("First Name");
          Map(m =&gt; m.LastName).Index(2).Name("Last Name");
  
          Map(m =&gt; m.MiddleName).Ignore();
      }
  }
  </code></pre>
  
  <p>And this is the code that I am using to generate the output:</p>
  
  <pre><code>var persons = new List&lt;Person&gt;
  {
      new Person {Id = 1, FirstName = "Randall", MiddleName = "Michael", LastName = "Perry"},
      new Person {Id = 2, FirstName = "Marigold", MiddleName = "Joanne", LastName = "Mercibar"},
      new Person {Id = 3, FirstName = "Sven", MiddleName = "Ergenfein", LastName = "Olafsson"}
  };
  
  using (var csvWriter = new CsvWriter(textWriter))
  {
      csvWriter.WriteRecords(persons);
      textWriter.Flush();
  }
  </code></pre>
  
  <p>My output is as follows:</p>
  
  <pre>
  Id,FirstName,MiddleName,LastName
  1,Randall,Michael,Perry
  2,Marigold,Joanne,Mercibar
  3,Sven,Ergenfein,Olafsson
  </pre>
  
  <p>How can I get it to stop writing the <code>MiddleName</code>?</p>