Possible Duplicate:
Deleting files and corresponding entries from database
I'm writing an ASP.NET application. I have a row in a database with physical path to a folder on disk. I want to delete the row and remove the directory in one transaction. I.e. make sure both are deleted or both are not.
I'm using Entity Framework to communicate with the database.
The folder to be removed contains images, which may be viewed by a web-site user. I'm afraid I could try to delete the folder at the moment an image is transferred to a user by IIS.