ASP.NET Core MVC预定任务 [英] ASP.NET Core MVC scheduled task
本文介绍了ASP.NET Core MVC预定任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要每天在asp.net mvc核心应用程序中运行计划的任务. 我可以做到吗,怎么做?!
I need to run a scheduled task on every new day in asp.net mvc core application. Can I do it, and how?!
thnx
推荐答案
随着DotNet Core 2的出现,新界面IHostedService
可以处理后台任务.
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.