title: How to handle empty column in parsing with CsvHelper?
body: <p>I have a CSV file, I'm trying to parse it, But getting the below error on int datatype column.In the file, I'm passing the blank or empty value for this column.</p>
  
  <pre><code>[AutoMap(typeof(Test))]
  [FileEntity("Test")]
  public class TestFileEntity : BaseFileEntity
  {
      [CsvFileColumn(1)]
      public int TestId { get; set; }
  }
  
  public IEnumerable&lt;BaseFileEntity&gt; Parse(Stream masterData, Type entityType, out IEnumerable&lt;MasterDataFileParserError&gt; errors)
  {
      var list = new List&lt;BaseFileEntity&gt;();
      var errorList = new List&lt;MasterDataFileParserError&gt;();
  
      try
      {
          using (var reader = new StreamReader(masterData))
          {
              var parser = new CsvReader(reader, new CsvHelper.Configuration.Configuration
              {
                  HasHeaderRecord = true,
                  HeaderValidated = null,
                  MissingFieldFound = null
              });
  
              list.AddRange(parser.GetRecords(entityType).Cast&lt;BaseFileEntity&gt;());
          }
      }
      catch (Exception ex)
      {
          if (ex.Data == null || ex.Data.Count == 0)
          {
              errorList.Add(new MasterDataFileParserError
              {
                  Error = ex.Message,
                  Description = ex.ToString()
              });
          }
          else
          {
              foreach (var key in ex.Data.Keys)
              {
                  errorList.Add(new MasterDataFileParserError
                  {
                      Error = ex.Message,
                      Description = $"{key}: {ex.Data[key]}"
                  });
              }
          }
      }
  
      errors = errorList;
  
      return list;
  }
  </code></pre>
  
  <p>Exception in this line: <code>list.AddRange(parser.GetRecords(entityType).Cast&lt;BaseFileEntity&gt;());</code></p>
  
  <p>Error: </p>
  
  <blockquote>
    <p>An error has occurred while parsing 'xyz.csv' file for 'Test' entity:
    '[{"Error":"The conversion cannot be performed.\r\n    Text: ''\r\n<br>
    MemberType: System.Int32\r\n    TypeConverter:
    'CsvHelper.TypeConversion.Int32Converter'","Description":"CsvHelper.TypeConversion.TypeConverterException:
    The conversion cannot be performed.\r\n    Text: ''\r\n    MemberType:
    System.Int32\r\n    TypeConverter:
    'CsvHelper.TypeConversion.Int32Converter'\r\n   at
    CsvHelper.Configuration.Configuration.&lt;>c.&lt;.ctor>b__148_4(CsvHelperException
    exception)\r\n   at
    CsvHelper.CsvReader.d__65.MoveNext()\r\n   at
    System.Linq.Enumerable.d__34<code>1.MoveNext()\r\n   at
    System.Collections.Generic.List</code>1.AddEnumerable(IEnumerable<code>1
    enumerable)\r\n   at
    System.Collections.Generic.List</code>1.InsertRange(Int32 index,
    IEnumerable<code>1 collection)\r\n   at
    Nec.Stanchion.Business.MasterDataFiles.Handling.MasterDataFileParser.Parse(Stream
    masterData, Type entityType, IEnumerable</code>1&amp; errors) in xyz.cs
    file"}]'.</p>
  </blockquote>
  
  <p>The reason is very clear, that blank or empty string is not compatible with <code>int</code> datatype, so there has to be some way to allow empty or null value with <code>int</code> datatype column value.</p>
  
  <p><strong>CsvHelper Version=6.0.0.0</strong></p>