Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InterceptWith() ignores Includes() #4

Open
RicoSuter opened this issue Mar 17, 2017 · 0 comments
Open

InterceptWith() ignores Includes() #4

RicoSuter opened this issue Mar 17, 2017 · 0 comments

Comments

@RicoSuter
Copy link

When I add an interceptor before the Includes(), the includes are not made by EF:

var activeAccounts = await ctx.Accounts
    .InterceptWith(new PropertyVisitor())
    .Include(a => a.Subject)
    .Where(a => a.IsActive)
    .ToListAsync();

But this works:

var activeAccounts = await ctx.Accounts
    .Include(a => a.Subject)
    .Where(a => a.IsActive)
    .InterceptWith(new PropertyVisitor())
    .ToListAsync();

The problem is, that I need to specify the interceptor first because I'd like to expose already intercepted IQueryables in my ctx so that the InterceptWith call is not needed by the ctx user...

FYI: I use https://github.com/StefH/Linq.PropertyTranslator.Core here...

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

No branches or pull requests

1 participant