I have a MVC3 app that uses EF4 POCO/repositories. Whenever a item is opened by the user on the website it is flagged in the database. There is a backend service that keeps checking if there are any items that have been flagged for more 'x' seconds and unflags them. The issue that I am running into is in my backend service the query that I run seems to find the flagged items but when I check the individual item for being flagged the entity hasn't refreshed.
Here is my code that looks for the flagged items
var list = Context.Transactions
.Where(t => t.Locked).ToList() ;
The list.Count() returns me the correct number. But when I start iterating thru' the list I find that t.Locked = false
When I run the SQL profiler I can see that for my above code data is retrieved from the database correctly. Is this caching or a identity map issue that I am not using the EF correctly.