//每年的1月1号自动更新节假日表 var allHolidayStr = BaseHelper.Get_HttpRequest("https://api.jiejiariapi.com/v1/holidays/" + DateTime.Now.ToString("yyyy")); if (allHolidayStr.IsNotNullOrEmpty()) { foreach (var item in JObject.Parse(allHolidayStr)) { var holidayDto = JsonConvert.DeserializeObject<HolidayClass>(item.Value.ToString()); if (holidayDto.isOffDay) //是节假日 { //保存数据 TbHoliday temp = new TbHoliday() { DateStr = DateTime.Parse(holidayDto.date) }; bs.SaveEntity(temp); } } }
标签:TbHoliday,节假日,C#,holidayDto,DateTime,allHolidayStr,var,入库 From: https://www.cnblogs.com/SmallChen/p/17496880.html