1
我試圖使用linq
從XML文件中提取名稱列表中MVC3
工作。中的LINQ MVC抱怨缺少引用
List<String> firstNames = (from p in x.Descendants("Row")
orderby p.Element("id").Value
select p.Element("firstName").Value).ToList();
編譯器不斷抱怨:
Error 1
Could not find an implementation of the query pattern for
source type 'System.Collections.Generic.IEnumerable<System.Xml.Linq.XElement>'.
'OrderBy' not found. Are you missing a reference to 'System.Core.dll' or a
using directive for 'System.Linq'
我檢查和System.Core
是在引用文件夾並沒有在文件中using System.Linq;
聲明。
任何人都知道爲什麼發生這種情況?