In asp.net web application, I want to write a file. This function will first receive data from the database, and then write a flat file.
What can I do to make only 1 record, and as soon as the record occurs, other streams that might want to write to the file do not happen from the moment of recording.
I want this recording to be done ONLY if it wasn’t done after 15 minutes.
I know there is a lock keyword, so I have to wrap everything in a lock and then check if it is updated in 15 minutes or more, or vice versa?
Update
Workflow:
Since this is a web application, multiple instances will be people viewing a particular web page. I could use the assembly in the cache system, but if asp.net processes it, it will be expensive to rebuild the cache, so I just want to write it to a flat file. My other option would be to simply create a Windows service, but this is the big management work I want.
public static
source share