Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CsvInputFormatter only gets properties by index not name #208

Open
matteus6007 opened this issue Aug 7, 2020 · 0 comments
Open

CsvInputFormatter only gets properties by index not name #208

matteus6007 opened this issue Aug 7, 2020 · 0 comments

Comments

@matteus6007
Copy link

When setting the property value it selects the property by index:

properties[i].SetValue(item, Convert.ChangeType(values[i], properties[i].PropertyType), null);

If you have set UseSingleLineHeaderInCsv then it should get property by name item.GetProperty("propertyName"), this allows for the headers to be in a different order to how the properties are ordered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant