CsvHelper
CsvHelper copied to clipboard
`CsvWriter.Context.Configuration.HasHeaderRecord = false` does not work as expected
In previous versions, csv.Configuration.HasHeaderRecord = false;
would prevent a CsvWriter from printing a header.
In the current version, csv.Context.Configuration.HasHeaderRecord = false;
no longer prevents a header from being printed.
If the configuration is supplied at construction time, e.g. new CsvWriter(writer, new CsvConfiguration(ci) { HasHeaderRecord = false });
then the header is not printed, as expected.
Could I work on it?
This is expected. All values from a configuration are copied locally in the constructor. csv.Configuration.HasHeaderRecord
is read only. The configuration on the context is there if you need to access the original config for some reason, but changes to it don't get applied anywhere.