Hi I am very new to C# and have to turn in a module for integration testing tomorrow. I was trying an easy and expidient way to read CSV files and stumbled on ChoETL: https://www.codeproject.com/Articles/1145337/Cinchoo-ETL-CSV-Reader?msg=5847644#xx5847644xx
Following their first example, I tried to run the code:
using ChoETL;
using System;
foreach (dynamic rec in new ChoCSVReader("Emp.csv")
.WithFirstLineHeader())
{
Console.WriteLine($"Id: {rec.Id}");
Console.WriteLine($"Name: {rec.Name}");
}
When I run it, I get the ouput:
Id: 1
Name: dynamic
Id: 2
Name: dynamic
Id: 3
Name: dynamic
Instead of:
Id: 1
Name: Tom
Id: 2
Name: Carl
Id: 3
Name: Mark
WHy is this? And what is rec being turned to at runtime? I don't know anythnig about dynamic types
I ran this on a Console project on NetCore 5.0 on VS2019