I am using Entity Framework 6.1.1 (SQL Server back end) in an MVC app with a service layer.
I want to read the database from the service layer to get a row from the database, update something on it to advise it is being processed to stop the next read picking up on it, then return it.
So basically if 2 users call the same service, they will both get different rows as the first read will update the record (say to change a column "Processing" to true). The second read will bypass this record and go to the next one.
I can't think of a way to do this using normal linq queries in EF. The only way I can think of doing it is using a stored procedure. Although I am not 100% sure yet how to do it in an SP. If that is the only option then I will investigate it more.
Can this be done using EF?