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.
I'm trying to read in a class such as the following where one/or more of the property names are available at runtime.
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?