我試圖做一個Visio Masters收集以下Linq查詢:爲什麼我不能在Visio Masters集合上使用Linq查詢?
List<string> allMasterNames = (from master in myStencil.Masters select master.NameU).ToList<string>
我收到以下錯誤:
Could not find an implementation of the query pattern for source type 'Microsoft.Office.Interop.Visio.Masters'. 'Select' not found. Consider explicitly specifying the type of the range variable 'master'.
從閱讀解決這個錯誤似乎當詢問對象不發生實施IEnumerable<T>
或IQueryable<T>
。這是這種情況,還是其他的?
我添加了答案&當我做了,你得到你需要的東西:) – shahkalpesh 2009-07-29 03:20:03