I have 2 or more Groups like below in a table:
Id Value GroupId
1 A 1
2 B 1
3 C 2
4 D 2
Now I wanna show total relationships (total: 2*2=4 since we have 2 groups each one with 2 members) like below:
A & C
A & D
B & C
B & D
Or with three Groups:
Id Value GroupId
1 A 1
2 B 1
3 C 2
4 D 2
5 E 3
6 F 3
We have 2*2*2=8 relationships:
A & C & E
A & D & E
B & C & E
B & D & E
A & C & F
A & D & F
B & C & F
B & D & F
But, how can I do this via Linq Expression? I want the result to show in View(razor).
Update: My meaning is Cartesian Product of Group members in the Table.