2011-01-20 105 views
0

我宣布我的通用功能如下泛型函数声明

public static Dictionary<TZerokey, Dictionary<TFirstKey, Dictionary<TSecondKey, TValue>>> 
    PivotCountry<TSource,TZeroKey, TFirstKey, TSecondKey, TValue> 
    (this IEnumerable<TSource> source,Func<TSource,TZeroKey> zerokeySelector, 
    Func<TSource, TFirstKey> firstKeySelector, 
    Func<TSource, TSecondKey> secondKeySelector, 
    Func<IEnumerable<TSource>, TValue> aggregate) 
{ 

    return null;//return value is not important for my question 
} 

我得到一个编译错误

TZerokey找不到。你是否缺少使用指令或程序集引用?

谁能告诉我什么是错我的声明?

在此先感谢

+0

编辑它。添加代码标签。它不可读。 – 2011-01-20 11:20:47

+0

编译错误对我来说是不言而喻的...... – Simone 2011-01-20 11:21:33

回答

5

是 - 你有一个错字:TZerokey在返回类型,但TZeroKey在类型参数。注意“K”的情况的区别。因此TZerokey找不到,但TZeroKey会。