I have System.Collections.Generic.Dictionary dict where A and B are classes, and an instance A a (where dict.ContainsKey(a)
System.Collections.Generic.Dictionary dict
A a
dict.ContainsKey(a)
As Dictionary implements IEnumerable>, you could use linq:
Dictionary
IEnumerable>
var pair = _dictionary.SingleOrDefault(p => p.Key == myKey);