Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Core MVC scheduled task

I need to run a scheduled task on every new day in asp.net mvc core application. Can I do it, and how?!

thnx

like image 747
Wasyster Avatar asked Oct 14 '16 19:10

Wasyster


1 Answers

With DotNet Core 2 came up a new interface IHostedService that will take care of background tasks.

Here you`ll have some examples how to handle schedule tasks.

Building a scheduled task in ASP.NET Core/Standard 2.0

Implementing background tasks in .NET Core 2.x webapps or microservices with IHostedService and the BackgroundService class

like image 116
Bruno Matuk Avatar answered Oct 26 '22 03:10

Bruno Matuk