I am using .Net 7 and Hangfire 1.8.5
Do all of hangfire's recurring jobs have to be listed directly in Program.cs ? Or can I abstract them out into a sub module? I'd rather have 20 recurring jobs in a seperate module than all in Program.cs
Program.cs :
app.UseHangfireDashboard();
app.MapHangfireDashboard();
// Hangfire Recurring Jobs
RecurringJob.AddOrUpdate<MyTestService>("Test Job", (x) => x.testJob("hangfire test
job"), Cron.Daily(8, 30));
....to infitity...
Could I have instead...
Program.cs :
app.UseHangfireDashboard();
app.MapHangfireDashboard();
BackgroundJobs jobs = new BackgroundJobs();
jobs.MyRecurringJobs();
I assume I'd need to pass something into this new BackgroundJobs class? How would I setup hangfire to work this way?