I'm working on a C# windows service that reads in a csv file into a List<model>
using CsvHelper along with it's class map by index functionality. I would like to store the original raw data row in each model.
I've tried using Map(m => m.Row).Index(-1);
but that did not work. I also tried ConvertUsing
, but I get a message that MemberMap does not contain a definition for 'ConvertUsing'.
The RegisterClassMap
and csv.GetRecords
functionality is doing a bulk read that doesn't give me an opportunity to capture the original raw data row.
Any help would be greatly appreciated. I need to create an email with the status (sending the data to a micro service) and the original raw data two, and would love to store it while CsvHelper is reading the file.