JoshClose / CsvHelper

Library to help reading and writing CSV files
http://joshclose.github.io/CsvHelper/
Other
4.65k stars 1.05k forks source link

Automatic matching of camel naming parameters in constructors #2164

Closed CodingOctocat closed 1 year ago

CodingOctocat commented 1 year ago
public class Foo
{
    public int Apple { get; set; }

    public Foo(int apple)
    {
        Apple = apple;
    }
}
Apple
1
2
3

throw CsvHelper.ReaderException, System.Windows.Markup.XamlParseException HeaderValidationException: Header with name 'apple'[0] was not found.

If the arguments in the constructor match the case of the fields in the CSV, then it works fine, but my CSV has Pascal-style fields and the constructor's formal parameters are usually camel-style, which makes it difficult.

CodingOctocat commented 1 year ago

[Duplicate] When using constructor read arguments as PascalCase #1719