I am trying to implement a caching pattern that Redis might need to use. The problem with this pattern is that I need to disable Configuration.ProxyCreationEnabled and then turn it back on to avoid any problems in the web farm.
I would like to access DbContext from IQueryable, so I can do it once, not everywhere. The easiest way to do this is to pass the DbContext to my caching extension, however I came across this message:
Access DataContext for IQueryable
Is there a way to access the DbContext similar to the link above using the EF 4.1 Code Fist (DbSet, etc.)?
I tried to find this myself, but tried to find the base class from the referenced DbSet in IQueryable using reflection.
source share