Where to put the RecorringJob.AddOrUpdate() function in the code (Asp.Net MVC5)


#1

OMG … I hate to even ask such a beginner question but I have no other choide ;-).

I’m using an ASP.NET MVC5 project and have successfully installed and configured Hangfire … yay!

The problem is that I need to configure a recurring job … the documentation says it is quite easy as such:

Recurring job registration is just as simple as background job registration – you only need to write a single line of code:

RecurringJob.AddOrUpdate(() => Console.Write(“Easy!”), Cron.Daily);

The problem I have is WHERE DO YOU PUT IT!!! LOL … told you it was a neophyte question.

Thanks in advance,

C. T. Blankenship