12,698,688 members (29,347 online)
Rate this:
See more:
```IDictionary<int, IList<int>> secondlevel = new Dictionary<int, IList<int>>();
IDictionary<int, IList<int>> thirdlevel = new Dictionary<int, IList<int>>();
secondlevel.Add(1, new List<int>(new int[] { 1, 2 }));
secondlevel.Add(2, new List<int>(new int[] { 3 }));
secondlevel.Add(3, new List<int>(new int[] { 4, 5, 6 }));

thirdlevel.Add(1, new List<int>(new int[] { 5, 6, 7, 8, 20, 13, 24 }));
thirdlevel.Add(2, new List<int>(new int[] { 23 }));
thirdlevel.Add(3, new List<int>(new int[] { 22, 25, 26, 27 }));
thirdlevel.Add(4, new List<int>(new int[] { 19, 28, 29, 30, 31, 38, 33 }));
thirdlevel.Add(5, new List<int>(new int[] { 32, 35 }));
thirdlevel.Add(6, new List<int>(new int[] { 34, 36, 37 }));```

The secondlevel's value is thirdlevel's key,now I get a value which is one of thirdlevel's value,I want to get its embranchment index,How to write Linq?
Eg:5 index is 0, 23 index is 7, 22 index is 0 ,19 index is 0,32 index is 7
Posted 12-May-12 15:48pm
Updated 12-May-12 15:49pm
v3
Clifford Nelson 12-May-12 21:05pm

I think you need to be a bit more clear for most people. I attempt to lookup embranchment index, and find nothing. Saying that 5 index is 0 does not make any sense to me since I see 0 nowhere in the lists. At least I can see 23 and 7. I probably could help you but am lost ast to what you want to accomplish.
Shahin Khorshidnia 14-May-12 13:34pm

What do you mean The secondlevel's value is thirdlevel's key?
The values of secondlevel are List but keys are int.

Top Experts
Last 24hrsThis month
 ProgramFOX 105 Richard MacCutchan 89 ppolymorphe 70 Peter Leow 50 Afzaal Ahmad Zeeshan 50
 OriginalGriff 3,771 Peter Leow 2,278 ppolymorphe 1,757 Mika Wendelius 1,753 Jochen Arndt 1,479