Why is IDbCommandTreeInterceptor being skipped on second query?
Answered here, query command trees are cached by model which means that command tree creation only happens the first time a query is executed. So how would I force EF to create new query commands, or if that is not possible how would I go about implementing an interceptor to achieve row level restrictions on the application level.
不要使用IDbCommandTreeInterceptor
而应使用派生自DbCommandInterceptor
的类并重写NonQueryExecuting
来完成您要在其中进行的工作。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.