CSVHelper version 2, .QuoteAllFields property gone, what replaces it?

Viewed 1962

I've been using CSV Helper fine, I set this property:

sv.Configuration.QuoteAllFields = true;

To place quotes around all fields. However, in version 2 this property is gone. Is there an equivalent? If not how do we continue to put quotes round all fields?

I can find nothing on Google or in the docs about this.

1 Answers

ShouldQuote replaces QuoteAllFields, QuoteNoFields, QuoteRequiredChars, and BuildREquiredQuoteChars.

You can do this now.

csv.Configuration.ShouldQuote = (field, context) => true;

They just haven't updated the documentation.

Source: https://github.com/JoshClose/CsvHelper/issues/1180

Related