Use StringBuilder to create string from a large number of records

suggest change
public string GetCustomerNamesCsv()
    List<CustomerData> customerDataRecords = GetCustomerData(); // Returns a large number of records, say, 10000+

    StringBuilder customerNamesCsv = new StringBuilder();
    foreach (CustomerData record in customerDataRecords)

    return customerNamesCsv.ToString();

Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents