I have two IEnumerable, one with a "Must-have" base of keys, the other with a lot of keys with all kinds of spellings (the same values but containing escape-sequences, different capitalization, etc). I want to create a mapping between every key of the first List to all the ones that correspond with the strings in the second List (Predicate is bool IsPossibleMatch(string a, string b)
)
So basically I want an IGrouping<string, IEnumerable<string>>
because that's exactly the structure of thing I'm looking for.
I tried various versions of keys.GroupBy((x,y) => IsPossibleMatch(x, y))
but couldn't get any of them to work.
Now I'm wondering : Is this even possible with group by? Or do I need to manually do this in some other kind of way?