Setting objects (not users) inactive after period of time in asp.net mvc
Posted
by bastijn
on Stack Overflow
See other posts from Stack Overflow
or by bastijn
Published on 2010-04-12T05:50:56Z
Indexed on
2010/04/12
5:53 UTC
Read the original article
Hit count: 322
asp.net-mvc
This question is mainly to verify my current idea. I have a series of objects which I want to be active for a specified amount of time. For instance objects like ads which are shown in the ad space only for the amount of time bought, objects in search results which should only pop up when active, and frontpage posts which should be set to inactive after a prespecified time.
My current idea is to just give those type of objects a StartDate and EndDate and filter the search routines to only show results which fall in the range StartDate < currentDate < EndDate.
Is this the normal structure or should there be some sort of auto-routine which routinely checks for objects which are "over-time" and set a property "inactive" to true or something. Seems like this approach is such a hassle since I need a checker which runs say, every 5 minutes, to scan all DB objects. Seems like a bad idea to me.
So is the first structure the most commonly used or are there any other options? When searching on google or SO the search queries only return results setting users inactive.
© Stack Overflow or respective owner