You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 5, 2019. It is now read-only.
Hi,
I tried to use this library for a filtering requirement my project has the other day.
It works great in terms of SQL - as long as a database query is actually run.
However, sometimes, the filter doesn't take effect and I think this is because EF has somehow 'cached' the entities - I know this because if I do a trace in SQL profiler, and refresh the page with changed parameters passed to the filter, then no new SQL query is run. The changed parameters have not taken effect.
However if I recycle the app pool, then refresh again with the changed paramters, then it does a new SQL query and the changed parameters take effect.
I was just wondering if there is any way round this?
Thanks
The text was updated successfully, but these errors were encountered:
You can use AsNoTracking method to always hit database ignoring cache
DbExtensions.AsNoTracking Method (IQueryable)
Entity Framework 5.0+
Returns a new query where the entities returned will not be cached in the DbContext or ObjectContext.
OK, thanks - although this has to be applied at point of query, rather than once that will take effect across the board.
If I have to change (all the possibly very many instances of) the query code, I might as well just change them to put the filter in the query.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
I tried to use this library for a filtering requirement my project has the other day.
It works great in terms of SQL - as long as a database query is actually run.
However, sometimes, the filter doesn't take effect and I think this is because EF has somehow 'cached' the entities - I know this because if I do a trace in SQL profiler, and refresh the page with changed parameters passed to the filter, then no new SQL query is run. The changed parameters have not taken effect.
However if I recycle the app pool, then refresh again with the changed paramters, then it does a new SQL query and the changed parameters take effect.
I was just wondering if there is any way round this?
Thanks
The text was updated successfully, but these errors were encountered: