Hi,
I'm using linq to load a csv file, but because the csv may have any number of columns, the object that it returns will need dynamic properties, and I can't figure out how to do that.
var data = from row in csvData
let col = row.Split(',')
select new
{
Field1 = data[0],
Field2 = data[1],
Field3 = data[2] // etc, etc
};
If possible, I'd like to name the properties by the name given in the csv file, rather than field1, field2, etc.
Thanks!