Example #1
0
 private List<Game> ParseGamesByTypeSport(SportType type)
 {
     var gameParser = this.parserList.SingleOrDefault(x => x.Type == type);
     var dictGames = gameParser.ParseSport();
     this.marketsIdsByTypeSport.Add(type, dictGames.ToDictionary(x => x.Value.Info, x => x.Key));
     return dictGames.Values.Select(x => new Game(x.Info, x.Coefficients, this.BetsName)).ToList();
 }
Example #2
0
 public IEnumerable<Game> ParseExtendedCoefficients(IEnumerable<GameInfo> games, SportType type)
 {
     var ids = new List<string>();
     if (this.marketsIdsByTypeSport.ContainsKey(type))
     {
         foreach (var game in games)
         {
             ids.Add(this.marketsIdsByTypeSport[type].SingleOrDefault(t => t.Key == game).Value);
         }
         return this.marketParser.ParseMarket(ids).Select(x => new Game(x.Info, x.Coefficients, this.BetsName)).ToList();
     }
     else
     {
         throw new Exception("SportType is not missing");
     }
 }
Example #3
0
        public IEnumerable<Game> ParseExtendedCoefficients(IEnumerable<GameInfo> games, SportType type)
        {
            this.UpdateGameList();

            return games.Select(x => this.cachedGames[type].FirstOrDefault(game => game.Info == x));
        }