Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 11631

CsvHelper - How to map by index the whole row to a model member

$
0
0

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.


Viewing all articles
Browse latest Browse all 11631

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>