Skip to content

CsvInputFormatter only gets properties by index not name #208

@matteus6007

Description

@matteus6007

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions