我正在尝试使用LINQ to XML对一些后代进行简单计数,并且"Count()"方法对我来说不存在?
例:
using System.Xml.Linq;
XDocument doc = XDocument.Load( "somexmlfile" );
int count = doc.Descendants("somethinghere").Count();
Run Code Online (Sandbox Code Playgroud)
以上将无法编译,因为它无法识别该Count()方法.