Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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);
              }
        }