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

Allow tuples to be used as join keys #35565

Open
roji opened this issue Feb 1, 2025 · 0 comments
Open

Allow tuples to be used as join keys #35565

roji opened this issue Feb 1, 2025 · 0 comments

Comments

@roji
Copy link
Member

roji commented Feb 1, 2025

When performing Join, EF currently only supports scalars and anonymous types (see #25075). The problem with anonymous types is that they can't be shared: you cannot have a property/function somewhere that's used in multiple queries, and which returns a key selector Expression<Func<...>>, since anonymous types are unspeakable and cannot appear in the Func signature (see #25075 (comment)). #25075 suggests allowing arbitrary POCOs as join keys, but that raises complex questions around equality behavior etc. which makes this undesirable.

A good solution here seems to be to allow tuples as join keys: these have clear equality semantics and can be named in Func signatures.

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

No branches or pull requests

1 participant