FileHelpers
FileHelpers copied to clipboard
Allow FieldHidden when using Autoproperties
Currently most of the attributes only work on fields. I need to ignore a property in my class when reading a file. The property is an autoproperty.
[DelimitedRecord( "," )]
class A {
[FieldHidden] //this throws an error because SomeProp is not a field
public int SomeProp { get; set; }
public int OtherProp { get; set; }
public int LastProp { get; set; }
}
I tried just adding Property to the AttributeUsage but it still didn't ignore the property and threw an exception because there were more fields in the class than in the CSV
+1
This seems to be done here : https://github.com/MarcosMeli/FileHelpers/commit/c6cd0f20607f7de33145115efdebcc68969484b9
Are you going to create a new release including at least these change on FieldHidden for properties ?