I want to write a report list of objects to csv without header so set the HasHeaderRecord to false.
but it's still adding columns' name as a header row.
`using (var writer = new StringWriter())
using (var csv = GetCsvWriter(writer, false))
{
csv.Context.RegisterClassMap();
var data = mapper.Map<List<ExportContactTracingReportModel>>(report) :
csv.WriteRecords(data);
}
public static CsvWriter GetCsvWriter(StringWriter writer, bool hasHeaderRecord = true)
=> new CsvWriter(writer,
new CsvConfiguration(CultureInfo.InvariantCulture)
{
InjectionOptions = InjectionOptions.Strip,
HasHeaderRecord = hasHeaderRecord,
});`
I want to write a report list of objects to csv without header so set the HasHeaderRecord to false. but it's still adding columns' name as a header row.
`using (var writer = new StringWriter()) using (var csv = GetCsvWriter(writer, false)) { csv.Context.RegisterClassMap();