Skip to content
This repository has been archived by the owner on Apr 5, 2019. It is now read-only.

Interception should plug into CSpace #12

Open
jonnybee opened this issue Aug 29, 2014 · 3 comments
Open

Interception should plug into CSpace #12

jonnybee opened this issue Aug 29, 2014 · 3 comments
Milestone

Comments

@jonnybee
Copy link
Contributor

to support models that have custom mappings to database. When interception runs in SSpace the mapping is already processed by EF so it only works when the code and database are the same. .

@cocowalla
Copy link

👍

jbogard added a commit that referenced this issue Sep 25, 2014
#12 Move filter to CSpace to work with mapped model and added unit test
@jbogard jbogard added this to the 0.3 milestone Sep 25, 2014
@gentledepp
Copy link

Interestingly, since I updated to version 0.3.0.0 the filters seems to not be applied at all to the queries:
When I look at the SQL output, my filters are not applied. Had to downgrade to 0.2.0.0 which works, but unfortunately caches the filter expressions. So I need to use the following unpleasant workaround:

            var objectContext = ((IObjectContextAdapter)Context).ObjectContext;
            var all = objectContext.CreateObjectSet<TEntity>();

            // Note we have to disable query cache because our filter convention (UsersFilter) from EntityFramework.Filter
            // modifies the query before it gets cached --> the parameters become constants!!
            var oq = all as ObjectQuery;
            oq.EnablePlanCaching = false;

Did you change anything on the API?

@jonnybee
Copy link
Contributor Author

No, to my knowledge I did not change the API. I did change the interception to occcur on CSpace (from SSpace). Could you provide me with a gist or sample to show when the filter is not applied correctly.

I do exepect that you must set EnablePlanCaching to false to make Filters work properly and the queries is cached inside EF.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants