Skip to content

Entity equality: support subquery and composite key #15972

Open

Description

See test Entity_equality_through_subquery_composite_key:

ctx.Orders
    .Where(o => o.OrderDetails.FirstOrDefault() == new OrderDetail
    {
        OrderID = 10248,
        ProductID = 11
    })
    .ToList());

Since OrderDetail has a composite key, the subquery would be evaluated twice.

We should be able to properly translate this by pushing the entity equality's column comparisons into the subquery.

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions