Example #1
0
 private static bool CompareMarkets(SportEventMarket x, SportEventMarket y)
 {
     return
         (x.Name == y.Name &&
          x.Number == y.Number &&
          CompareSelections(x.Selections, y.Selections) &&
          x.IsClosed == y.IsClosed);
 }
Example #2
0
        private static SportEventMarket ParseMarket(XElement marketImport)
        {
            if (marketImport == null)
            {
                throw new ArgumentNullException(nameof(marketImport));
            }

            var market = new SportEventMarket {
                Id         = int.Parse(marketImport.Attribute("ID").Value),
                Number     = int.Parse(marketImport.Attribute("Number").Value),
                Name       = marketImport.Attribute("Name").Value,
                Selections = marketImport.Elements().Where(x => x.Name == "Selection").Select(ParseSelection).ToArray(),
                IsClosed   = marketImport.Attribute("Status")?.Value == "Close"
            };

            return(market);
        }