Fix for distinct calculator with duplicate keys - #274
Conversation
|
Just some analyzers picking up some errors there |
|
Apologies, have removed trailing whitespace |
|
Roland has been away lately so if he doesn't respond in the next day, I will get some other Dynamic Data regulars and myself to do a review. |
glennawatson
left a comment
There was a problem hiding this comment.
Looks reasonable to me. Thanks for having the unit test and the issue to understand what's going on.
|
Thanks Glenn, I think this makes the DistinctCalculator more robust, perhaps for scenarios that weren't envisaged originally like duplicate keys. My use case is I'm trying to produce a list of distinct child items from a list of parents where there is some overlap in the child items between parents. This is where I came across the issue in the first place. Investigating further this is very similar to the |
|
This PR is great thanks and no reason not to merge. Incidentally, the example code as stated is similar to using Or and that you have used MergeMany to compensate for a missing dynamic Or operator (or TransformMany) operator. There is a need for me to add new overloads of Or and TransformMany. Regardless, this fix will also apply when those operators have been implemented. |
What kind of change does this PR introduce?
Fixes #273
What is the current behavior?
Exception with duplicate keys as described in issue
What is the new behavior?
Exception resolved, new unit test added
What might this PR break?
No change to existing functionality, all unit tests pass
Please check if the PR fulfills these requirements
Other information:
Not sure what documentation I need to update for this bug fix