I'am using ExcelNPOIStorage but I need to implement INotifyRead, but this is not working.
This is the class:
public class User : INotifyRead
{
public string FirstName;
public string LastName;
public void AfterRead(AfterReadEventArgs e)
{
}
public void BeforeRead(BeforeReadEventArgs e)
{
}
}
This is how I use ExcelNPOIStorage:
var provider = new ExcelNPOIStorage(typeof(User))
{
StartRow = 0,
StartColumn = 0,
FileName = pathToFile,
SheetName = "Users"
};
provider.ErrorManager.ErrorMode = ErrorMode.SaveAndContinue;
var res = (User[])provider.ExtractRecords();
But never do 'BeforeRead', additinally I cannot use Optional parameter like this: [FieldOptional]
Do I need to do something else?
ExcelStorageBase which is inherited by ExcelNPOIStorage does not implement the filehelper INotify interfaces. In fact, it doesn't implement the older BeforeRecord/AfterRecord events either according to the code online.