public List<TEAM> AllTeams(string xml) { var teams = new List<TEAM>(); var teamNodes = new List<XmlNode>(); var xmlTeams = new XmlDocument(); xmlTeams.LoadXml(xml); var el = xmlTeams.DocumentElement; var nodelist = el.ChildNodes; for (var i = 0; i < nodelist.Count; i++) { if (nodelist[i].Name == "Team") { teamNodes.Add(nodelist[i]); } } foreach (var node in teamNodes) { var nodeEl = XElement.Parse(node.OuterXml); var tempTeam = new TEAM() { API_TEAM_ID = Convert.ToInt32(nodeEl.XPathSelectElement("//*[local-name()='Team_Id']").Value), COUNTRY = nodeEl.XPathSelectElement("//*[local-name()='Country']").Value, TEAM_NAME = nodeEl.XPathSelectElement("//*[local-name()='Name']").Value, STADIUM = nodeEl.XPathSelectElement("//*[local-name()='Stadium']").Value }; teams.Add(tempTeam); } return teams; }
partial void DeleteTEAM(TEAM instance);
partial void UpdateTEAM(TEAM instance);
partial void InsertTEAM(TEAM instance);