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

Include doesn't work with Skip/Take #4615

Closed
cbmek opened this issue Feb 22, 2016 · 6 comments
Closed

Include doesn't work with Skip/Take #4615

cbmek opened this issue Feb 22, 2016 · 6 comments
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Milestone

Comments

@cbmek
Copy link

cbmek commented Feb 22, 2016

When i do simple include (for one-to-many relation) it works ok:

_context.MyCollection.Include(m => m.OtherItem).ToList()'

But when I also add Skip/Take to it, the Include is dropped, and reference property is null.

_context.MyCollection.Include(m => m.OtherItem).Skip(10).Take(20).ToList()'

It always worked ok, so what am I doing wrong with EF7?

Edit: I've also checked SQL query in debug mode, and it just don't use any JOINs after adding Skip/Take.

@cbmek
Copy link
Author

cbmek commented Feb 22, 2016

I just found out that it didn't do Include (INNER JOIN) not because of skip/take only but also because of Select. So it seams that this order don't do inner join:

_context.MyCollection.Include(m => m.OtherItem).Skip(10).Take(20).Select(...)

but this one works ok:

_context.MyCollection.Include(m => m.OtherItem).Select(...).Skip(10).Take(20)

@cbmek cbmek closed this as completed Feb 22, 2016
@divega
Copy link
Contributor

divega commented Feb 22, 2016

Reopening so that we can take a look. @maumar does this sound like a dupe?

@divega divega reopened this Feb 22, 2016
@divega
Copy link
Contributor

divega commented Feb 22, 2016

Looks somewhat similar to #3804. Cc @anpete

@anpete
Copy link
Contributor

anpete commented May 11, 2016

Verified fixed.

@anpete anpete closed this as completed May 11, 2016
@thefenix1
Copy link

thefenix1 commented Aug 14, 2016

I still see this problem. Which version is this fixed in? I'm using rc1 and include is NOT working for me when using skip and take

Thanks!

@smitpatel
Copy link
Contributor

@thefenix1 - It is fixed in RTM release which is available on nuget.

@ajcvickers ajcvickers added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Projects
None yet
Development

No branches or pull requests

7 participants