简体   繁体   中英

How would i force EF to create new query commands every time or Or how would I go about implementing an interceptor to achieve row level restrictions?

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM