Example #1
0
 public static List<XmlNode> SelectNodesEx(this XmlNode node, string name) {
     return node?.Cast<XmlNode>().Where(x => x.Name == name).ToList();
 }
 /// <summary>
 /// Returns the number of items present within the specified enumerable (returns 0 if the enumerable is null).
 /// </summary>
 /// <param name="enumerable">The enumerable.</param>
 /// <returns>The number of items present within the specified enumerable (returns 0 if the enumerable is null).</returns>
 public static long Count(this IEnumerable enumerable)
 {
     return enumerable?.Cast<object>().LongCount() ?? 0;
 }
Example #3
0
 public static XmlNode SelectSingleNodeEx(this XmlNode node, string name) {
     return node?.Cast<XmlNode>().FirstOrDefault(x => x.Name == name);
 }