CsvDataReader and ExcelDataReader should share an interface #122
Replies: 3 comments 4 replies
-
I end up with this internal class:
|
Beta Was this translation helpful? Give feedback.
-
To continue on the same discussion around validation, when I validate the exact same file saved in different format (csv and excel), the
UPDATE: Thanks!
|
Beta Was this translation helpful? Give feedback.
-
Here is my Sylvan wrapper around CsvDataReader and ExcelDataReader:
|
Beta Was this translation helpful? Give feedback.
-
First, thank you for your awesome library!! I will participate for sure to enhance it because I love it!
I have to implement a data import and I need to support all the main Excel file types: csv, xls, xlsx.
I have a FileManager.ReadExcel that encapsulate all the IFormFile stream manipulation, validations. etc.
I also use the DbDataReader.GetRecord so both CsvDataReader and ExcelDataReader share the same code with the same options.
My problem is that I need to get access to the
RowNumber
andRowFieldCount
for validations and these are not accessible through DbDataReader (or the interface IDataReader). I have to cast it in a method likeGetRowFieldCount(IDataReader)
I know this can affect performances, create overhead, etc.
I think it could be a nice improvement to have an interface for these properties (and probably more other properties/methods) that both readers shared:
Instead of doing a fix just for myself, I would like to share it with you and your community.
I will probably fork your code and create a PR but I would like to have your thought about this before doing it!
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions