在ICollection <Tuple >上实现.Contains()的最简单方法
假设我有一个Dictionary<String, Tuple>
,我想确定任何一个字典值是否有T1的T1。 我怎样才能最优雅地做到这一点?
LINQ?
嗯,这是我想到的:
var exists = dict.Values.Any(t => t.Item1 == v1);
bool b = dictionary.Any(item => item.Value.Item1 == searchTerm);