How to create a nested group by query in LINQ for the below table:
Code Mktcode Id
1 10 0001
2 20 0010
1 10 0012
1 20 0010
1 20 0014
2 20 0001
2 30 0002
1 30 0002
1 30 0005
I want to get the above and convert it to the data structure of the sort
Dictionary< Code, List<Dictionary< Mktcode, List<Id>>>>
.
So the result of this dictionary would be
{1, ({10,(0001,0002)}, {20,(0010,0014)}, {30, (0002, 0005)})},
{2, ({20,(0001, 0010)}, {30, (0020)} )}