I have an extension for IEnumerable collections like this:
public static bool IsNullOrEmpty<T>(this IEnumerable<T> enumerable) {
return enumerable == null || !enumerable.Any();
}
It works for a lot of collections except for XmlNodeList.
Why is that? XmlNode implements IEnumerable ??
Please help
It is because
XmlNodeListimplementsIEnumerable, notIEnumerable<T>, you can use below instead: