ConcurrentDictionarydict = new ConcurrentDictionary (); dict.TryAdd(1, 5); dict.TryAdd(2, 10); dict.TryAdd(3, 15); bool anyGreaterThanTen = dict.Values.Any(x => x > 10); // true
ConcurrentDictionaryThe ConcurrentDictionary is a part of the System.Collections.Concurrent namespace in C#.dict = new ConcurrentDictionary (); dict.TryAdd("key1", "value1"); dict.TryAdd("key2", "value2"); dict.TryAdd("key3", "value3"); bool anyKeyContainsString = dict.Keys.Any(x => x.Contains("2")); // true