title: How do you implement (and null) BadDataFound
body: <p>Based on the instructions in Getting Started with CsvHelper, I have the following code except for the csv.Configuration.BadDataFound line:</p>
  <pre><code>using (var csv = new CsvReader(tr, CultureInfo.InvariantCulture))
          {
              List&lt;string&gt; badPeople = new List&lt;string&gt;();
              csv.Configuration.BadDataFound = context =&gt; badPeople.Add(context.RawRecord);
              try
              {
                  var people = csv.GetRecords&lt;Person&gt;();
                  var count = people.Count();
                  response = await Http.PostAsJsonAsync(&quot;api/people/batch&quot;, people);
                  Message = $&quot;{response}: {selectedFile.Count} file uploaded&quot;;
              }
              catch (Exception ex)
              {
                  Message = ex.Message;
              }
          }
  </code></pre>
  <p>I configured the BadDataFound line based on suggestions from the following:</p>
  <ul>
  <li><a href="https://stackoverflow.com/questions/46848741/handling-bad-csv-records-in-csvhelper">Handling bad CSV records in CsvHelper</a></li>
  <li><a href="https://stackoverflow.com/questions/60211106/csvhelper-logging-errors-when-baddataexception-is-thrown">CSVHelper: logging errors when BadDataException is thrown</a></li>
  <li><a href="https://stackoverflow.com/questions/55181148/csvhelper-baddatafound-in-a-valid-csv">CSVHelper BadDataFound in a valid csv</a>
  and numerous others.</li>
  </ul>
  <p>In the CsvHelper.Configuration documentation it states:</p>
  <blockquote>
  <p>Gets <strong>or sets</strong> the function that is called when bad field data is found. A field has bad data if it contains a quote and the field is not quoted (escaped). You can supply your own function to do other things like logging the issue instead of throwing an exception. Arguments: context</p>
  </blockquote>
  <p>I keep getting the error that BadDataFound does not have a setter, and based on what I saw when looking at the code on GitHub, that makes sense. The error message I get when I run without the BadDataFOund line states that one can ignore the BadDataFound by nulling it.</p>
  <p>To complicate matters, there is also no &quot;RawRecord&quot; in the context that I can find.</p>
  <p>How do I get this to work?</p>