language: C# (mono-2.8)
date: 358 days 17 hours ago
link:
visibility: private
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using System;
using System.Linq;
using System.Xml;
using System.Xml.Linq;
 
public class Test
{
        public static void Main()
        {
 
string dtNowTest = "2012-05-24T19:00:00:000";
string url = "http://urslit.1x2.is/urslit/xml.exe/atburdir?dagsetning=" + dtNowTest;
 
var leikurs = (from e in XDocument.Load(url).Descendants("Mot")
                           where (e.Attribute("Audkenni").Value == "ISL001")
                           from m in e.Descendants("Leikur")
                           select new Game()
                                      {
                                          Status = m.Attribute("StadaLeiks").Value,
                                          Hometeam = m.Element("Heimalid").Attribute("StuttHeiti").Value,
                                          Outteam = m.Element("Utilid").Attribute("StuttHeiti").Value,
                                          GoalsHometeams = Int32.Parse(m.Element("MorkHeimalids").Value),
                                          GoalsOutteams = Int32.Parse(m.Element("MorkUtilids").Value)
                                      }
                          );
 
            var result = leikurs
                .GroupBy(d => new { Heimalid = d.Hometeam, Utilid = d.Outteam })
                .Select(g => g.OrderBy(d => d.Status)
                .ThenByDescending(d => d.GoalsHometeams + d.GoalsOutteams)
                .First());
 
 
 
 
        }
}
 
prog.cs(4,18): error CS0234: The type or namespace name `Linq' does not exist in the namespace `System.Xml'. Are you missing an assembly reference?
Compilation failed: 1 error(s), 0 warnings