6
A
回答
9
IList<T>
未定義名爲ConvertAll()
的方法。你可以看到這裏的定義:http://msdn.microsoft.com/en-us/library/5y536ey6.aspx
有一種方法具體實現List<T>
; http://msdn.microsoft.com/en-us/library/73fe8cwf.aspx
您可以使用LINQ語句.Select()
複製此行爲。
2
你將不得不使用System.Collections.Generic.List
在基地有一個.ConvertAll()
方法。
IList
不執行.ConvertAll()
。
如果您必須使用IList
,您可以隨時編寫自己的.ConvertAll()
方法。
什麼是實際類型?也許它已經是List <>? – leppie 2010-12-06 04:26:40