A FileHelpers class is just a way of defining the specification of a flat file using a limited C# syntax as the definition language. As such, the FileHelpers classes are an unusual type of C# class and you should not try to use them in any other way. Think of the FileHelpers class as the 'specification' of your CSV format only. That should be its only role. If you need the records in a more 'normal' object (in your case, you need properties instead of fields), then map the results to something better like this:
FileHelperEngine engine = new FileHelperEngine<FileHelpersOrder>();
var records = engine.ReadFile("FileIn.txt");
var niceOrders = records.Select(
x => new NiceOrder()
{ Number = x.Number,
Customer = x.Customer
// etc.
});
Where FileHelpersOrder
is your CSV specification and the NiceOrder
class would be a proper OOP class with properties, methods, etc. as necessary.
If you're exporting, then you need to do the opposite, i.e., select a collection of FileHelpersOrder
from a collection of NiceOrder
.