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: Nested and outer query results are tracked separately #8864

Closed
AndriySvyryd opened this issue Jun 15, 2017 · 0 comments · Fixed by #17107
Closed

Query: Nested and outer query results are tracked separately #8864

AndriySvyryd opened this issue Jun 15, 2017 · 0 comments · Fixed by #17107
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. punted-for-2.1 punted-for-3.0 type-bug
Milestone

Comments

@AndriySvyryd
Copy link
Member

This results in different instances returned for the same entity:

[ConditionalFact]
public virtual void Select_nested_projection()
{
    using (var context = CreateContext())
    {
        var customers = context.Customers
            .Where(c => c.CustomerID.StartsWith("A"))
            .Select(c => new
            {
                Customer = c,
                CustomerAgain = Get(context, c.CustomerID)
            })
            .ToList();

        Assert.Equal(4, customers.Count);
        foreach (var customer in customers)
        {
            // This fails
            Assert.Same(customer.Customer, customer.CustomerAgain);
        }
    }
}

private Customer Get(NorthwindContext context, string id)
    => context.Customers.Single(c => c.CustomerID == id);
@ajcvickers ajcvickers added this to the Backlog milestone Jun 16, 2017
@anpete anpete changed the title Nested and outer query results are tracked separetely Nested and outer query results are tracked separately Jun 21, 2017
@ajcvickers ajcvickers modified the milestones: Backlog, 2.1.0 Sep 13, 2017
@ajcvickers ajcvickers modified the milestones: 2.1.0-preview1, 2.1.0 Jan 17, 2018
@ajcvickers ajcvickers modified the milestones: 2.1.0, Backlog Jan 26, 2018
@ajcvickers ajcvickers changed the title Nested and outer query results are tracked separately Query: Nested and outer query results are tracked separately May 16, 2018
@AndriySvyryd AndriySvyryd assigned smitpatel and unassigned smitpatel Aug 8, 2019
@AndriySvyryd AndriySvyryd added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Aug 12, 2019
@AndriySvyryd AndriySvyryd modified the milestones: Backlog, 3.0.0 Aug 12, 2019
AndriySvyryd added a commit that referenced this issue Aug 12, 2019
AndriySvyryd added a commit that referenced this issue Aug 12, 2019
AndriySvyryd added a commit that referenced this issue Aug 12, 2019
@ajcvickers ajcvickers modified the milestones: 3.0.0, 3.0.0-preview9 Aug 21, 2019
@ajcvickers ajcvickers modified the milestones: 3.0.0-preview9, 3.0.0 Nov 11, 2019
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. punted-for-2.1 punted-for-3.0 type-bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants