假设我有一个词典<字符串,元组LT; T1,T2>>
,我想,以确定是否任何字典值有V1其T1。我将如何做到这一点最优雅?
Suppose I have a Dictionary<String, Tuple<T1,T2>>
and I want to determine if the any of the dictionary values has V1 for its T1. How would I do this most elegantly?
LINQ的?
那么,这想到的:
var exists = dict.Values.Any(t => t.Item1 == v1);