Reputation: 4692
People on the inet advise to use "using" clause with the dbcontext.. That means the dbcontext object is getting disposed.. If that's the case, then how this dbcontext will get benefit of having second level caching (http://msdn.microsoft.com/en-us/magazine/hh394143.aspx) ?
Upvotes: 0
Views: 494
Reputation: 69260
The article you link to hooks inte EF's provider model an implements cache at a lower layer than the DbContext. You should still use the DbContext as a unit of work and dispose of it as soon as you're done with one set of operations.
Upvotes: 1