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

Bind member on result of single entity result subquery #28752

Closed
smitpatel opened this issue Aug 16, 2022 · 0 comments · Fixed by #28781
Closed

Bind member on result of single entity result subquery #28752

smitpatel opened this issue Aug 16, 2022 · 0 comments · Fixed by #28781
Assignees
Labels
area-query closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Milestone

Comments

@smitpatel
Copy link
Contributor

    [ConditionalTheory]
    [MemberData(nameof(IsAsyncData))]
    public virtual Task Update_Where_Join_set_property_from_joined_table(bool async)
    => AssertUpdate(
        async,
        ss => from c in ss.Set<Customer>().Where(c => c.CustomerID.StartsWith("F"))
              select new { c, LastOrder = c.Orders.OrderByDescending(o => o.OrderDate).FirstOrDefault() },
        e => e.c,
        s => s.SetProperty(c => c.c.City, c => c.LastOrder.OrderDate.ToString()),
        rowsAffectedCount: 35,
        (b, a) => Assert.All(a, c => Assert.NotNull(c.City)));

We fail to translate c.LastOrder.OrderDate because we don't correctly process the ShapedQueryExpression from c.LastOrder to recognize it as entity reference in SqlTranslator.

Could affect #28524

@smitpatel smitpatel self-assigned this Aug 16, 2022
@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 Aug 18, 2022
smitpatel added a commit that referenced this issue Aug 18, 2022
Visit retrived ProjectionBinding from select expression as projection binding can bind to non-SqlExpression too.

Resolves #28524
Resolves #28745
Resolves #28752
@smitpatel smitpatel added this to the 7.0.0 milestone Aug 18, 2022
smitpatel added a commit that referenced this issue Aug 19, 2022
Visit retrived ProjectionBinding from select expression as projection binding can bind to non-SqlExpression too.

Resolves #28524
Resolves #28745
Resolves #28752
@ajcvickers ajcvickers modified the milestones: 7.0.0, 7.0.0-rc1 Aug 22, 2022
@ajcvickers ajcvickers modified the milestones: 7.0.0-rc1, 7.0.0 Nov 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-query 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

Successfully merging a pull request may close this issue.

2 participants