0

I have just started learning asp.net and C#. I need to create a function that runs once a week, every Monday and returns a new entry in my SQL database.

Does anyone have any suggestions for how I should approach this? And are you aware of any ways to have this kind of functionality without a data log table that checks if the function has already been run for that week?

isla_just
  • 41
  • 6
  • Look at Quartz. It's a scheduling nuget package. – Neil Mar 31 '22 at 12:37
  • Hey, maybe this question can help you out: https://stackoverflow.com/questions/7394806/creating-scheduled-tasks – Vulpex Mar 31 '22 at 12:41
  • If you work with Windows Server you can use the Task Scheduler and make it run your programm once a week. https://learn.microsoft.com/en-us/troubleshoot/windows-server/system-management-components/schedule-server-process – Kiwimanshare Mar 31 '22 at 12:43
  • Thanks so much for the help, I'll give it a try – isla_just Mar 31 '22 at 13:34

2 Answers2

0

Try Hangfire - it can schedule a job and repeat it.

namey
  • 9
  • 2
0

There are some solutions to do this. Check this out: [https://www.hanselman.com/blog/how-to-run-background-tasks-in-aspnet][1]

Reza Ariyan
  • 721
  • 3
  • 13