Is is possible to serialize fields (not just properties) with CsvHelper?

665 views Asked by At

I'm using CsvHelper but I'd like to be able to serialize fields and not just properties. Is there a way to do this?

Note that this is hard to search for, because the documentation uses the word "Field" to mean a class property, but I'm talking about an actual class field, that is, MyIntField in this class:

class Something
{
    public int MyIntProperty {get; set;}
    public int MyIntField;
}
1

There are 1 answers

5
Josh Close On BEST ANSWER

No, it is not currently possible. You get an error message

'MyIntField' is not a property. Did you try to map a field by accident?