0

I'm using ScheduleWidget and need to generate a schedule every (x) day. It could be any number. I also need to option to include or exclude weekends. Any tips on how to do this?

var dailyBuilder = new ScheduleBuilder();
var dailySchedule = dailyBuilder.HavingFrequency(FrequencyType.Daily).Create();

This will build every day without skipping days, but I'd like something that is "Every 3 days" for example.

Community
  • 1
  • 1

2 Answers2

0

In Quartz.net 2.0, there is new triggertype called Calendar interval trigger. It has the following interval units:

IntervalUnit

  • Minute
  • Hour
  • Day
  • Week
  • Month
  • Year

Else look at it here: Quartz.NET, Recur Every x Weeks

Gauravsa
  • 6,330
  • 2
  • 21
  • 30
0

Depending on what you are trying to accomplish you could have a look at Hangfire. In hangfire you can also schedule recurring jobs based on a cron expression (like you could with quartz). With cron expressions you can create any type of interval.

http://docs.hangfire.io/en/latest/background-processing/processing-jobs-in-console-app.html

Hangfire or any kind of jobs is also a good idea from architectural standpoint. This way you can nicely apply the separation of concerns principle.

Jobse
  • 166
  • 1
  • 13