Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public List<League> getLeagues()
- {
- List<League> temp = new List<League>();
- List<string> tempIds = new List<string>();
- List<string> tempNames = new List<string>();
- XDocument doc = XDocument.Load("C:\\Users\\Saphiron\\documents\\visual studio 2012\\Projects\\Pineczive\\Pineczive\\App_Data\\Leagues.xml");
- var ids = doc.Descendants("id");
- var names = doc.Descendants("name");
- foreach (var i in ids)
- {
- tempIds.Add(i.Value.ToString());
- }
- foreach (var n in names)
- {
- tempNames.Add(n.Value.ToString());
- }
- for (int i = 0; i < tempIds.Count(); i++)
- {
- temp.Add(new League(tempIds[i], tempNames[i], false, "cze",string.Empty, string.Empty));
- }
- return temp;
- }
Advertisement
Add Comment
Please, Sign In to add comment