Below are 3 ways to iterate over the keys and values in a dictionary:
// iterate over C# Dictionary Keys and Values
foreach (KeyValuePair<string, string> entry in myDictionary)
{
// do something with entry.Value or entry.Key
}
// itrate over C# Dictionary Values only
foreach (var key in myDictionary.Keys)
{
// do something with key
}
// iterate over C# Dictionary Keys only
foreach (var value in myDictionary.Values)
{
// do something with value
}