/// <summary> /// Process the "hostnames" section of the XML document /// </summary> /// <param name="names">Object representing the hostnames section</param> /// <returns>A collection of hostnames as strings if the hostname exists, empty otherwise</returns> private static IEnumerable <string> HostnamesSection(hostnames names) { return(names != null && names.hostname != null ? names.hostname.Select(x => x.name) : Enumerable.Empty <string>()); }
/// <summary> /// Process the "hostnames" section of the XML document /// </summary> /// <param name="names">Object representing the hostnames section</param> /// <returns>A collection of hostnames as strings if the hostname exists, empty otherwise</returns> private static IEnumerable<string> HostnamesSection(hostnames names) { return names != null && names.hostname != null ? names.hostname.Select(x => x.name) : Enumerable.Empty<string>(); }