2011-08-24 70 views
0

嗨我在下面的代碼,用2 *在前面突出顯示的代碼得到此錯誤。任何人都可以幫忙嗎?錯誤 - 使用泛型類型'System.Collection.Generic.List <T>需要'1'類型參數

using System; 
using System.Collections.Generic; 
using System.Text; 
using System.Collections; 


namespace ConsoleApplication5 
{ 
class SStructure 
{ 

    **List<Property.Prop, List<Property.AddProp>> propset;** 


    public SStructure(List<Property.Prop, **List<Property.AddProp>> propset**) 
    { 

     this.propset = propset; 

    } 


} 

}

+3

該錯誤非常具有描述性。您試圖將2個類型參數傳遞給'List ',它只接受1個類型參數。 –

+1

我知道沒有列表。也許你想要[字典](http://msdn.microsoft.com/en-us/library/xfhwa508.aspx)? –

+0

你能建議我該怎麼做?我不確定,因爲我是C#的新手。 – CPDS

回答

3

泛型類List<T>只有一個類型參數 - 你想傳遞兩個。

相關問題