Are there any chances to have the MultiRecordEngine set the line number for each record? I read the documentation and found that the Engine has a LineNumber property, but I couldn't find a way to use it.
What I would like to have: i.e.:
[FixedLengthRecord]
public class Employee
{
public int LineNumber; // <-- setup by the engine while reading the file
[FieldFixedLength(1)]
public string Type = "2";
[FieldFixedLength(6)]
[FieldTrim(TrimMode.Left, "0")]
public int ID;
}
Or... can I rely on the index of the record in the collection created by the Engine.ReadFile? i.e.:
static void Main(string[] args)
{
var engine = new MultiRecordEngine(CustomSelector, _types);
var obj = engine.ReadFile("order.txt");
// obj.GetValue(100) returns same record found on the 101th line in the file?
}
INotifyRead<Employee>
instead of using theAfterReadRecord
event. Then all the code is in the FileHelpers class. – Surplusage