Is there a better way to use C# dictionaries than TryGetValue?
https://softwareengineering.stackexchange.com/questions/396567/is-there-a-better-way-to-use-c-dictionaries-than-trygetvalue
WEBAug 27, 2019 · Actually, it's pretty easy to iterate over a dictionary, since it does implement IEnumerable: var dict = new Dictionary<int, string>(); foreach ( var item in dict ) { Console.WriteLine("{0} => {1}", item.Key, item.Value); } If you prefer Linq, that too works out just fine: dict.Select(x=>x.Value).WhateverElseYouWant();
DA: 55 PA: 59 MOZ Rank: 16