Write an object with a List<T> field to CSV
问题 I'm learning C# and object serialization. I need to save an object in a .csv file. I tried CsvHelper but couldn't find the answer to my question. Suppose I have an object like this: public class Record { ... public List<string> Collection { get; set; } ... } How do I use CsvHelper to store the values of Collection in a .csv file along with other primitive types in a record of csv file? 回答1: Collections are ignored by CsvHelper by default. However, using a ClassMap you can use Index to