This article explains that query plan caching can be deactivated by setting EnablePlanCaching
to false
on the ObjectQuery
, and also that it is enabled by default in EF6.
Alas, EF6 doesn't have an ObjectQuery
, the DbSet
's give you DbQuery
s.
I don't think I can get an ObjectQuery
from the DbQuery
, and I certainly don't want to use the old ObjectContext
. So is that it or is there a way to disable plan caching in EF6?
Here is an extension method that will let you get an ObjectQuery from the DbSet