on-internet
← Community

How do I use the latest CsvHelper 34.0.0 inside Linqpad 8?

Stack Overflow ·

I'm guessing the way LinqPad adds the Order class to a UserQuery class is keeping the CsvHelper source generator from being able to use the [CsvRecord] annotation. I'm getting the following error. UserQuery+Order has no CSV mapper. Mark it [CsvRecord] and partial, and reference the CsvHelper source generator. void Main() { using var reader = CsvReader.FromFile(@"C:\Temp\orders.csv"); var records = reader.GetRecords<Order>(); records.Dump(); } // You can define other methods, fields, classes and namespaces here [CsvRecord] public partial class Order { public string Id { get; set; } = ""; [CsvCo

Comments

Sign in or sign up to comment and upvote.

No comments yet.