I have a list of items "listItems", like this
Id Code Value
1 'a' '1'
2 'a' '2'
3 'b' 'x'
4 'b' 'y'
and want to obtain a dictionary,
'a' => '1', '2'
'b' => 'x', 'y'
I tried
listItems.ToDictionary(x => x.Code, x => x.Value), but this returns a Dictionary<string, string>, I would like to have a Dictionary<string, IList<string>>