Skip to content

InterceptWith() ignores Includes() #4

Description

@RicoSuter

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...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions