My understanding of the Entity Framework is that if it can answer a query from its cache, it will. My simple testing, however, shows repeated queries hit the database even though they were previously answered positively:
var u1 = context.Users.SingleOrDefault(u => u.Id == 1);
var u2 = context.Users.SingleOrDefault(u => u.Id == 1);
These queries are successful. For each, I see a SELECT TOP (2) in SQL Profiler.
Why does EF go to the database for that second query?
Well, because EF doesn’t use caching. nHibernate does. Here article on how to enable caching with EF.
Edit: EF doesn’t have transparent out-of-the-box cache. But it has explicit cache within unit of work:
ObjectContext.GetObjectByKey