0
在实体框架(任何版本)中是否存在与此Rails辉煌的用于清除数据库查询缓存的等价物?我一直有这个问题,似乎无法找到一个简单的方法来解决这个问题:实体框架缓存刷新
所有的关联方法是围绕高速缓存,这使可用于进一步操作的最近查询的结果建立。缓存甚至可以在不同的方法间共享......
但是如果你想重新加载缓存呢,因为数据可能已经被应用程序的其他部分改变了?只是通过真该协会电话:
customer.orders # retrieves orders from the database
customer.orders.size # uses the cached copy of orders
customer.orders(true).empty? # discards the cached copy of orders
# and goes back to the database