In such a construction:
Dictionary<myObject, Dictionary<myEnum, secondObject>> myDict;
I use foreach to search all items in outer Dictionary:
foreach (var elem in myDict)
{
//I need to make some modifications in inner Dictionary for chosen myEnum
}
How to do this?
The
foreachloop on aDictionaryenumerates key-value pairs. The key is inelem.Key; the value (i.e. your target inner dictionary) iselem.Value.