Пример #1
0
        /// <summary>
        /// метод возвращает набор событий с пинакл api по футболу(prematch,live) имеющие хотя-бы один половинчатый тотал и гандикап для fulltime
        /// </summary>
        /// <returns></returns>
        public async Task <List <OddEvent> > LoadIntrestingEventsFromPinnacleAsync(bool isLive)
        {
            List <OddEvent> _intrestingEvents = new List <OddEvent>();

            OddResponse oddResponse = await this.pinnacleClient.GetOddsBySportIdAsync("29", isLive);



            foreach (OddLeague league in oddResponse.Leagues)
            {
                List <OddEvent> events = league.Events;

                if (events.Count != 0 && events != null)
                {
                    foreach (OddEvent oddEvent in events)
                    {
                        this.SetOddEventParams(oddEvent);

                        if (this.IsEventIntresting2(oddEvent) == true)
                        {
                            this.SetHandicapsForEvent(oddEvent);
                            _intrestingEvents.Add(oddEvent);
                        }
                    }
                }
            }



            return(_intrestingEvents);
        }
Пример #2
0
        public async Task <OddResponse> GetOddsBySportIdAsync(string sportId, bool islive)
        {
            string urlPath = "/v1/odds" + "?sportId=29&oddsFormat=DECIMAL";

            if (islive == true)
            {
                urlPath = urlPath + "&isLive=1";
            }


            HttpResponseMessage result = await this.GetHttpResponseAsync(urlPath);

            string content = await result.Content.ReadAsStringAsync();

            OddResponse oddResponse = JsonConvert.DeserializeObject <OddResponse>(content);

            return(oddResponse);
        }