我有一个字典,它包含一个元组函数和一个 int
Dictionary<Tuple<string,string>, int> fullNames = new Dictionary<Tuple<string,string>, int>();
Tuple 类定义为
public class Tuple<T, T2>
{
public Tuple(T first, T2 second)
{
First = first;
Second = second;
}
public T First { get; set; }
public T2 Second { get; set; }
}
我想这样使用 Containskey 函数
if (fullNames.ContainsKey(Tuple<"firstname","lastname">))
但我收到一个过载错误。有什么建议么?