Rename CSV column headings?

When I use myObjectList.ToCsv() is there a way to rename the column headings?

I want the csv to be the same as my PostgreSQL columns names. ORMLite changes PropertyName to property_name.

At the moment the headings appear like PropertyName in the CSV but I want them to be property_name.

Is there any example of this?

When returning typed POCOs you would rename properties by using [DataMember(Name="NewName")] which is the standard way for all Serializers.

CSV also allows specifying custom headers in code, see:

1 Like

CsvConfig<MyObject>.CustomHeadersMap is Ideal, thanks.