I have a list of object which all expose a property of type IList. Now I want to group this list by the values of that list. So let say for example:
OB1: Property is A, B, C
OB2: Property is D, C, E
OB3: Property is B, E, C
As output I would like to have
A: OB1
B: OB1, OB3
C: OB1, OB2, OB3
D: OB2
E: OB2, OB3
I thought about a convenient LINQ expression to solve this, but it could not find any reference if it is possible at all. Of cause I can to it with loops... but I'am curious if it is possible with LINQ.
Thanks
You can try: