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

Mixing FieldIndex and Name to read a dynamic column name #38

Open
kowsheek opened this issue Mar 9, 2015 · 0 comments
Open

Mixing FieldIndex and Name to read a dynamic column name #38

kowsheek opened this issue Mar 9, 2015 · 0 comments

Comments

@kowsheek
Copy link

kowsheek commented Mar 9, 2015

I'm trying to read in a class such as the following where one/or more of the property names are available at runtime.

public class BreakdownCSV
{
      [CsvColumn(FieldIndex = 1)]
      public string BreakdownProperty { get; set; }
      [CsvColumn(Name = "Day of Week Name")]
      public DayOfWeek DayOfWeekName { get; set; }
      [CsvColumn(Name = "SessionName")]
      public string SessionName { get; set; }
}

but the BreakdownProperty value is coming up as null. As far as I understand, this is because the reader isn't able to read properties without the matching the property's name or it being specified in the attribute.

How would I go about doing this?

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