Ejemplo n.º 1
0
        private void HandleMarathons()
        {
            var root = this.xDoc.Root;

            root.Add(
                new XElement(ns + "url",
                             new XElement(ns + "loc", string.Concat(baseURL, "Search/Marathons")),
                             new XElement(ns + "priority", "1.0"),
                             new XElement(ns + "changefreq", "weekly")
                             )
                );

            var marathons = Marathons.Get(false);

            foreach (var marathon in marathons)
            {
                root.Add(
                    new XElement(ns + "url",
                                 new XElement(ns + "loc", string.Concat(baseURL, "Marathon/", marathon.Id)),
                                 new XElement(ns + "priority", "1.0"),
                                 new XElement(ns + "changefreq", "weekly")
                                 )
                    );
            }
        }
        /// <summary>
        /// Default constructor
        /// </summary>
        public MarathonResultsDesignModel()
        {
            Marathons = new[]
            {
                "2014 - Japan",
                "2015 - Berlin",
            };
            Marathon = Marathons.First();

            Distances = new[]
            {
                "10 км малый марафон",
                "42 км полный марафон"
            };
            Distance = Distances.First();

            Genders = new[]
            {
                "Любой",
                "Мужской",
                "Женский"
            };
            Gender = Genders.First();

            AgeCategories = new[]
            {
                "18 - 29",
                "30 - 35",
                "36 - 45"
            };
            AgeCategory = AgeCategories.First();

            TotalRunnersCount    = 1234;
            FinishedRunnersCount = 1198;
            AverageTime          = new TimeSpan(4, 2, 10);

            ResultsCondition = new MarathonResultsCondition
            {
                Marathon    = Marathon,
                Distance    = Distance,
                Gender      = Gender,
                AgeCategory = AgeCategory
            };

            Results = new MarathonResultsListDesignModel();
        }