Sandeep Thomas
Sandeep Thomas

Reputation: 4727

convert object to CSV string without header Servicestack CSVSerializer

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

Upvotes: 2

Views: 2047

Answers (1)

mythz
mythz

Reputation: 143319

You can omit headers for being written per Type with:

CsvConfig<MyType>.OmitHeaders = true;

Upvotes: 5

Related Questions