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

Query: Included navigations are not fixed up in loaded related data #9271

Closed
ComptonAlvaro opened this issue Jul 27, 2017 · 1 comment
Closed
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

@ComptonAlvaro
Copy link

ComptonAlvaro commented Jul 27, 2017

I am using T-Sql to get some records and in the same query I use Include() to include related entities of the entities that I get in the T-Sql.

At the end, in the dbContext, I have all the entities, the entities that I get from the T-Sql and the entities that I get from the Include(), but EF only relates the entities that I get from the T-Sql, but not the entities that I get from the Include().

I add the link to on drive with an example that reproduces this error. The application has two tests, the test that reproduce this error is the Test02, and I have comments in the code that explain the expected behavior and comment the result that I get.

https://1drv.ms/u/s!AiTepLSbavZ0gRfxbvJr6mkF2fAo

@ComptonAlvaro ComptonAlvaro changed the title When I use raw sql and include(), not all the navigation properties are setted When I use raw sql and include(), not all the navigation properties are setted (2.0.0-preview2) Jul 27, 2017
@smitpatel
Copy link
Member

Issue:
When we query data, (without include) changetracker does fix up of all navigations.
When we query data with include, the include pipeline fixup navigation included and change tracker deals with the rest of navigations. this was done as optimization.
But the include was doing limited fixup in the sense that it would fix up included navigations in direct results but it would not fix up navigations of included objects even if available in memory.

This repros in 1.1.2 but works correctly in 2.0.0 packages.

@smitpatel smitpatel added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Jul 27, 2017
@smitpatel smitpatel added this to the 2.0.0 milestone Jul 27, 2017
@smitpatel smitpatel changed the title When I use raw sql and include(), not all the navigation properties are setted (2.0.0-preview2) Query: Included navigations are not fixed up in loaded related data Jul 27, 2017
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

3 participants