-
Notifications
You must be signed in to change notification settings - Fork 416
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
FullGroupJoin with null keys #1000
Comments
Technically, this matches the behavior of Example: new int?[] { 1, 2, null, 4, 5, 1, 2, 4, null, null, 3, 6, }
.Join(
new int?[] { 2, 3, 4, null, 1, 2, 7, null, 4, 2, 1, },
x => x,
x => x,
(a, b) => (a, b)) A There's room for debate over whether |
Whoah what a foot gun! This took me a few hours to track down deep in a codebase.
I quickly hacked around it by removing the check, and it seems to work but I don't quite understand the code enough to be sure: Line 98 in 03a160c
|
@fowl2
Sure.
Not really. |
I expected that FullGroupJoin will return all items, even those with null keys, but somehow FullGroupJoin does not return null keys.
I tried implementing custom comparer, but it did not help.
So to fix this, I am currently using "clever hack" for key functions using tuple: p => (p.Id, true).
This treats null keys as non-null. A record would work too I guess.
Is there any more clear way to make FullGroupJoin not ignore null keys?
Null keys do not work: https://dotnetfiddle.net/iefSBj
Null keys work: https://dotnetfiddle.net/QS7ZNK
The text was updated successfully, but these errors were encountered: