예제 #1
0
        public List<LEAGUE> AllLeagues(string xml)
        {
            
            var leagues = new List<LEAGUE>();
            var leaguesNodes = new List<XmlNode>();

            var xmlLeagues = new XmlDocument();
            xmlLeagues.LoadXml(xml);
            var el = xmlLeagues.DocumentElement;
            var nodelist = el.ChildNodes;
            for (var i = 0; i < nodelist.Count; i++)
            {
                if (nodelist[i].Name == "League") { leaguesNodes.Add(nodelist[i]); }
            }



            foreach (var node in leaguesNodes)
            {

                var nodeEl = XElement.Parse(node.OuterXml);

                var tempLeague = new LEAGUE
                {
                    API_LEAGUE_ID = Convert.ToInt32(nodeEl.XPathSelectElement("//*[local-name()='Id']").Value),
                    COUNTRY = nodeEl.XPathSelectElement("//*[local-name()='Country']").Value,
                    LEAGUE_NAME = nodeEl.XPathSelectElement("//*[local-name()='Name']").Value,
                    LATEST_MATCH_DATE = DateTime.Parse(nodeEl.XPathSelectElement("//*[local-name()='LatestMatch']").Value)
                };

                leagues.Add(tempLeague);
            }

            return leagues;
        }
예제 #2
0
 partial void DeleteLEAGUE(LEAGUE instance);
예제 #3
0
 partial void UpdateLEAGUE(LEAGUE instance);
예제 #4
0
 partial void InsertLEAGUE(LEAGUE instance);