i want to translate this line of code from php to asp.net
$subid[$value['parentid']][] = $value['id'];
i’m not familiar with asp.net data structure, i’ve tried arraylist but can’t insert at [1], dictionary do not allow duplicated keys, anyone have ideas?
thanks
I’m not familiar with PHP (anymore) and SO is not a translation service, but you can use
List<Tuple<int, int>>or
Lookup<int, int>instead (assuming that your ids are ints).
With
Enumerable.ToLookupyou can create aLookup.Find all products with parent-id = 1: