Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ID,Type,Name,Description,Image
- 11,Variation,MyCoolProduct,A super cool product, Image1 | Image2
- var records = new List<Columns>
- {
- new Columns {ID = 12, Type = "Variation", Description = "Simple product with different colors",
- Images = "Image1 | Image 2", Price = 19.99d}
- };
- using (StreamWriter sw = new StreamWriter("Testfile.csv"))
- {
- var writer = new CsvWriter(sw);
- writer.WriteRecords(records);
- }
- public class ColMap : CsvClassMap<Column>
- {
- public ColMap()
- {
- Map(m=>m.ID).Name("ID").Index(0);
- .
- .
- .
- }
- }
Add Comment
Please, Sign In to add comment