Esempio n. 1
0
        public List<CrimeScene> GetCrimeScenes()
        {
            XDocument element = XDocument.Load(uri);
            var crimes = element.Descendants("events").Descendants("event")
                .Select(el => new CrimeScene
                {
                    Description = el.Element("description").Value,
                    Accuracy = int.Parse(el.Element("accuracy").Value),
                    Place = el.Element("place").Value,
                    Text = el.Element("text").Value
                }
                    )
                    .ToList();

            var scenes = new List<CrimeScene>();

            foreach (var item in crimes)
            {
                var sceneOfCrime = new CrimeScene
                {
                    Description = item.Description,
                    Accuracy = item.Accuracy,
                    Place = item.Place,
                    Text = item.Text
                };
                scenes.Add(sceneOfCrime);
            }
            return scenes;
        }
Esempio n. 2
0
        public List <CrimeScene> GetCrimeScenes()
        {
            XDocument element = XDocument.Load(uri);
            var       crimes  = element.Descendants("events").Descendants("event")
                                .Select(el => new CrimeScene
            {
                Description = el.Element("description").Value,
                Accuracy    = int.Parse(el.Element("accuracy").Value),
                Place       = el.Element("place").Value,
                Text        = el.Element("text").Value
            }
                                        )
                                .ToList();

            var scenes = new List <CrimeScene>();

            foreach (var item in crimes)
            {
                var sceneOfCrime = new CrimeScene
                {
                    Description = item.Description,
                    Accuracy    = item.Accuracy,
                    Place       = item.Place,
                    Text        = item.Text
                };
                scenes.Add(sceneOfCrime);
            }
            return(scenes);
        }