Click here to Skip to main content
15,886,919 members

Comments by astuserp (Top 2 by date)

astuserp 24-Feb-13 22:02pm View    
Hi Dave, Thanks for quick response.

The file is actually a standalone file. It has no relationship with other file. Also the autogenerate record ID is not really in use. Actually, I can retrieve the record using traditional ADO.NET but since other files are created with CodeFirst, then I think why not use the same method to retrieve the record.
If I can not find any elegant way to perform the traditional record processing in CodeFirst, then I think I will use the old way of retrieving the record.

Thanks Dave.
astuserp 24-Feb-13 21:10pm View    
Thanks Dave for your idea.

Sorry for not giving a proper reason why I need to delete the record in the first place.
The reason that I retrieve a record and delete it immediately is because I don't want the
same record being retrieved by others.
So once I retrieve a record, the same record can not be retrieved by other users.

I know that you may say that put a flag in the record that signify it is being used. But the problem with this kind of flag is when suddenly there is a power outage and the server is down. Then when the server is up again, the record is still being flaged.

But thanks again for your idea to delay SaveChange. It was not thought off at all.