问题描述
使用实体框架,我已经实现了软删除& IDbCommandTreeInterceptor限制数据级别.对于使用上下文的第一个查询,拦截器会命中.但是,再试一次(刷新浏览器),拦截器将被跳过.我已经通过使用SQL Server Management Studio更改某些数据来检查是否正在缓存数据.更改已反映出来,但拦截器仍被跳过.造成这种情况的原因可能是什么?
Using entity framework I have implemented soft delete & data level restriction with IDbCommandTreeInterceptor. For the first query using the context, the interceptor gets hit. But trying again (refreshing browser), the interceptor is skipped. I have checked whether data is being cached by changing some data using SQL server management studio. The changes are reflected but the interceptor is still skipped. What could possibly be causing for this to happen?
推荐答案
根据消息来源的评论,这是预期的行为
因此,您的拦截器结果不能依赖于数据.
As a consequence your interceptor result can not depend on the data.
这篇关于为什么在第二次查询时跳过IDbCommandTreeInterceptor?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!