static void PopulateProductsFromXml(XmlNodeList nodes, List <SecurityProduct> products) { foreach (XmlNode node in nodes) { XmlNodeList servicesNodes = node.FirstChild.ChildNodes;// SelectNodes("/Services/Service"); List <string> listOfServices = servicesNodes.Cast <XmlNode>().Select(n => n.InnerText).ToList(); var product = new SecurityProduct() { name = node.Attributes["Name"].Value, services = listOfServices }; products.Add(product); } }
static void PopulateProductsFromXml(XmlNodeList nodes, List<SecurityProduct> products) { foreach (XmlNode node in nodes) { XmlNodeList servicesNodes = node.FirstChild.ChildNodes;// SelectNodes("/Services/Service"); List<string> listOfServices = servicesNodes.Cast<XmlNode>().Select(n => n.InnerText).ToList(); var product = new SecurityProduct() { name = node.Attributes["Name"].Value, services = listOfServices }; products.Add(product); } }