I have a C# dictionary Dictionary<MyKey, MyValue>
and I want to split this into a collection of Dictionary<MyKey, MyValue>
, based on MyKey.KeyType
. KeyType
is an enumeration.
Then I would be left with a dictionary containing key-value pairs where MyKey.KeyType = 1
, and another dictionary where MyKey.KeyType = 2
, and so on.
Is there a nice way of doing this, such as using Linq?