2011-01-20 107 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會。