I have a budgeting application that sets a budget for n months how can the application know if n months have passed and to unapply the budget? How does mvc automatically check?
Steve's answers above make a simple example of doing that. If you want to make it automatically, you should put it on some services and call it from a scheduler or some services like Hangfire or Quartz.
(DateTime.Now - StartDate)
If this validation has something to do with sending an email notification and so on, I prefer check it from Database and make an SQL job to run it every day or anytime you think its fit in.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With