public IEnumerable <RawArticle> GetRawArticlesFrom(string source) { if (source == null) { throw new ArgumentNullException(nameof(source)); } return (recordReader .ReadAllRecordsFrom(new ExcelSource(source)) .Select(record => recordToRawArticleMapper.Map(record))); }
public IEnumerable <Record> ReadAllRecordsFrom(ExcelSource source) { try { return(decoratedReader.ReadAllRecordsFrom(source)); } catch (IOException) { throw new FileOpenedByAnotherProcessException(); } catch (ExcelDataReader.Exceptions.HeaderException) { throw new NotAnExcelFileException(); } }