convert object to CSV string without header Servicestack CSVSerializer

Viewed 1359

I'm using Servicestack.text CSV serializer to serialize an object into CSV format. Here is the way Im trying

CsvSerializer.SerializeToString(MyObject)

But it converts into CSV including the headers like this

ID,Name, Age\r\n13,Alex,45

But I dont need those headers. Is there is any way to exclude the header

1 Answers

You can omit headers for being written per Type with:

CsvConfig<MyType>.OmitHeaders = true;
Related