I am not able to use Any()
on XmlNodeList
. I have also used System.Linq and System.Xml.Linq namespaces as well. But still I'm not finding any such extension methods on XmlNodeList
.
How I can use it??
The problem is that XmlNodeList
only implements IEnumerable
, not IEnumerable<T>
. The simplest way to use LINQ on it is to call Cast
:
var query = nodeList.Cast<XmlNode>()
.Where(...)
...;
Alternatively, ditch the old XML API and use LINQ to XML, which is a much nicer API in general and supports LINQ really nicely :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With