How can I convert a list of objects to csv?

c#, csv, generics, linq, list

Solution

- FileHelpers Library

- Text OleDb Provider

- Manual via String concatenation according to RFC-4180

- Third party library, for example Aspose.Cells can do it without any friction from you. And it is very fast.

Problem

If I have a list of objects called "Car": ``` public class Car { public string Name; public int Year; public string Model; } ``` How do I convert a list of objects, e.g. List<Car> to a csv?

Original source

Related problems