private static Stream GetFileOrThrow(List <CsvFileDto> packageFiles, CovidStatisticsFileName fileName) { var retVal = packageFiles.SingleOrDefault(x => x.Name == fileName)?.File ?? throw new CovidStatisticsParsingFileNotFoundException(fileName); return(retVal); }
public CovidStatisticsParsingFileNotFoundException(CovidStatisticsFileName name) : base(String.Format("Could not find file with name: {0}", name)) { }