I use the same database from various applications using the Entity Framework. However, when one application reads / updates a record, I do not want other applications to read this data.
I tried using the following code example; however, they can still read the recording.
Any suggestion OR different approaches would be highly appreciated!
using (Entities context = new Entities(ConnectionString)) { DBTable entity; do { entity = context.DBTable .Where(item => item.IsLock == false) .FirstOrDefault(); if (entity != null) {
Edited: Basically, I read a record and do something (sometimes it takes a lot of time). Then update the record using the success / failure flag (if you cannot perform another action again). I do not want other applications to complete the task successfully several times.
Win source share