Based on the comments, you're using
CsvHelper[
^] to export data to a CSV file, and you want to change the titles of the columns.
There's no need to change the property name to do that. Just set up
a class mapping[
^]:
public class CustomerMap : CsvClassMap<Customer>
{
public CustomerMap()
{
Map(m => m.CustId).Name("CustomerId");
Map(m => m.CusName).Name("CustomerName");
}
}
...
using (var writer = new CsvWriter(...))
{
writer.Configuration.RegisterClassMap<CustomerMap>();
writer.WriteRecords(listOfCustomers);
}