public void Execute() { var year = DateTime.Now.Year; _repository.DeleteHolidaysByYear(year); foreach (var enumValue in Enum.GetValues(typeof(CountryCodesEnum))) { var holidays = _naggerClient.GetPublicHolidays(year, enumValue.ToString()).Result; holidays.ForEach(x => x.EndDate = x.Date.AddHours(24)); _repository.InsertHolidays(holidays); } }