locked
Changing property after specific time in ASP Core MVC RRS feed

  • Question

  • User-1741097413 posted

    I'm working on a subscription-based system developed using Asp Core 3 MVC and Sql Server. The payment is handled externally, not linked to the application in any way. All I need to do in the application is to check the user's status, that is managed by an admin. When a user registers the status will be Pending, when the admin approves the user, Approval Date will be saved in the database, and the status will be changed to Approved.

    The tricky thing for me is that I want the application to wait for 365 days before it changes the user status to Expired. I've no idea from where to start this part and would appreciate your help.

    Saturday, October 3, 2020 9:55 PM

All replies

  • User475983607 posted

    The tricky thing for me is that I want the application to wait for 365 days before it changes the user status to Expired. I've no idea from where to start this part and would appreciate your help.

    Simple.  Add an expiration column and that is 365 from the approval date.

    Saturday, October 3, 2020 10:08 PM
  • User-1741097413 posted

    -

    Saturday, October 3, 2020 10:16 PM
  • User-1741097413 posted

    mgebhard

    Simple.  Add an expiration column and that is 365 from the approval date.

    Thank you for the reply, I thought of it but then what? when the system checks the duration?

    I would appreciate if you can be more specific.

    Saturday, October 3, 2020 10:17 PM
  • User475983607 posted

    Thank you for the reply, I thought of it but then what? when the system checks the duration?

    I would appreciate if you can be more specific.

    What needs clarification?  If you know the expiration date then a simple filter will do just fine.

    SELECT aValue
    FROM aTable
    Where theExpirationDate > GETDATE()

    What is a "system check" in your application design?  Why is a duration needed when the expiration is known?  

    Saturday, October 3, 2020 10:24 PM