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()
方法。
相關問題
- 1. C#List <T> .ConvertAll在.NET 2.0中
- 2. 使用LINQ,如何將IList <IList <object>>轉換爲IList <object>?
- 3. 是否收集<T>包裝IList <T>或枚舉IList <T>?
- 4. T []是否實施IList <T>?
- 5. IList <IList<T>>到IReadonlyCollection <IReadonlyCollection <T>>
- 6. EF 4.0存儲庫模式IList <T>或IEnumerable <T>
- 7. 爲什麼Socket.Select(...)需要IList而不是(也)IList <Socket>?
- 8. 目標.net 4.5但部署到.net 4.0是否有可能?
- 9. IList <InterfaceType>爲List <ImplementsInterfaceType>?
- 10. 將IList <T1>轉換爲IList <BaseT1>
- 11. .NET 4.0 Page.Response.Write與<%= %>
- 12. IEnumerable <>到IList <>
- 13. <xsl:import> in <xsl:for-each>是否有可能或替代?
- 14. 是否有可能使用XAML風格WPF/.NET 4.0
- 15. 轉換「任務<IList<T>>」到「的IList <T>」
- 16. 是否有可能擁有一個屬性爲IEnumerable <T>?
- 17. IList <IWebElement>可以使用PageObject嗎?
- 18. .NET 4.0是否帶有Microsoft.Jet.OLEDB.4.0?
- 19. 是否有可能將ArrayList <Integer>轉換爲ArrayList <Long>?
- 20. 你爲什麼不能自IList <IParent>轉換爲IList的<IChild>其中ICHILD實現IParent
- 21. ConvertAll <Guid>(Guid.Parse)如何工作?
- 22. 是否有可能在.NET
- 23. 任務<IList<>>爲Func鍵<>的結果
- 24. 自IList <object_type>
- 25. 爲只讀屬性公開IList <T>或ReadOnlyCollection <T>?
- 26. 變量的List <>是否可能?
- 27. C#中List <GraphicsPath>是否可能?
- 28. 如何實例化嵌套IList <T>的IList <T>?
- 29. Binding Gridview to IList <BusinessObject>包含IList <BusinessObject>
- 30. 投的IList <int>到IList的<string>
什麼是實際類型?也許它已經是List <>? – leppie 2010-12-06 04:26:40