Exemple #1
0
 public IEnumerable <Record> ReadAllRecordsFrom(ExcelSource source)
 {
     using (var stream = File.Open(source.FilePath, FileMode.Open, FileAccess.Read))
     {
         using (var reader = ExcelReaderFactory.CreateReader(stream))
         {
             return(ReadRecordsFromReader(reader));
         }
     }
 }
Exemple #2
0
 public IEnumerable <Record> ReadAllRecordsFrom(ExcelSource source)
 {
     try
     {
         return(decoratedReader.ReadAllRecordsFrom(source));
     }
     catch (IOException)
     {
         throw new FileOpenedByAnotherProcessException();
     }
     catch (ExcelDataReader.Exceptions.HeaderException)
     {
         throw new NotAnExcelFileException();
     }
 }