C# System.Linq.Lookup Class Removing and Adding values

Viewed 23061

I'm using Lookup class in C# as my prime data container for the user to select values from two Checked List boxes.

The Lookup class is far easier to use than using the class Dictionary>, however I cannot find methods for removing and adding values to a lookup class.

I thought about using the where and the union, but i cant seem to get it right.

Thanks in advance.

2 Answers

what you can do instead of using a LookUp class is to simply use this

var dictionary = new Dictionary<string, List<A>>(); 

where A is the object type you want to map to the key. i trust you know how to add and delete the group of matched objects to a specific key. :)

Related