You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The List gets populated with the corresponding rows from the txt file but the columns (DataRowItem object) are empty.
I used the debugger to follow the execution into the ReadData class. All the values are retrieved as expected and you can inspect them before they get yield returned. After this point they get lost
The text was updated successfully, but these errors were encountered:
I manage to make it work by "hacking" (not using the cool meaning of the word) the ReadData function in the CsvContext.cs
This is my changed, inside the "while (cs.ReadRow(row, charLengths))" loop
if (readingRawDataRows)
{
var newObj = new T() as IDataRow;
foreach (DataRowItem item in (IEnumerable) row)
newObj.Add(new DataRowItem(item.Value, item.LineNbr));
obj = newObj as T;
}
else
{
obj = fm.ReadObject(row, ae);
}
So if it is reading raw data rows, it will instantiate a new Datarow object, making a deep copy of the row variable and passing it to the obj variable.
My understanding of generics is limited but I think this might work.
There is a problem when you use try to read raw data fields using the form
Then using the code:
IEnumerable<MyDataRow> products = cc.Read<MyDataRow>("products.csv", inputFileDescription);
The List gets populated with the corresponding rows from the txt file but the columns (DataRowItem object) are empty.
I used the debugger to follow the execution into the ReadData class. All the values are retrieved as expected and you can inspect them before they get yield returned. After this point they get lost
The text was updated successfully, but these errors were encountered: