I have to execute action once a day. It is to end users work time if they haven’t done it themselves.
Users can end their time by clicking on button that execute ActionResult in Controller:
[HttpPost]
[Authorize]
public ActionResult EndWork(...)
{
...
}
How can I run action like that automatically every day at midnight? Do I have to use task scheduler or Windows Service for it? I can’t set trigger on database, because records are inserted to database by EndWork().
I have a MVC 3 website.
Any help much appreciated!
You can use following :
Write a windows service which keeps a watch on your DB and performs the action.
For scheduling, please see Quartz .Net