/// <summary> /// 执行 /// </summary> public static async Task ExecuteAsync(SampleContext context) { var beginTime = DateTime.Parse("2021-01-01 00:00:00"); var endTime = DateTime.Parse("2022-01-01 00:00:00"); var dateRange = new DateTimeRange(beginTime, endTime); var days = dateRange.GetDays(); for (int i = 0; i < days; i++) { var currentBeginTime = beginTime.AddDays(i); var currentEndTime = beginTime.AddDays(i + 1); await ExecuteAsync(context, currentBeginTime, currentEndTime); } }