public BankHoliday[] GetLastYearsBankHols(OriginCountry countryOfOrigin = OriginCountry.EnglandAndWales) { BankHolidaysData bankHolData = GetBankHolData(); BankHoliday[] bankHols = bankHolData.GetAllYearsBankHols(countryOfOrigin); return(bankHols.Where(x => x.Date.Year == DateTime.Now.Year - 1).ToArray()); }
public BankHoliday[] GetSpecifiedYearsBankHols(int year, OriginCountry countryOfOrigin = OriginCountry.EnglandAndWales) { BankHolidaysData bankHolData = GetBankHolData(); BankHoliday[] bankHols = bankHolData.GetAllYearsBankHols(countryOfOrigin); if (!bankHols.Any(x => x.Date.Year == year)) { throw new ArgumentOutOfRangeException(); } return(bankHols.Where(x => x.Date.Year == year).ToArray()); }