Пример #1
0
        /// <summary>
        /// The API GetMarket service allows the customer to input a
        /// Market ID and retrieve all static market data for the
        /// market requested. To get a Market ID for the betting
        /// market associated with an event you are interested in,
        /// use the GetEvents command.
        /// </summary>
        /// <param name="exchangeId"></param>
        /// <param name="marketId"></param>
        /// <returns></returns>
        public BetfairExchangeAPI.Market GetMarket(int exchangeId, int marketId)
        {
            const string serviceName = "GetMarket";

            Console.WriteLine("{0}$ API_SERVICE {1}", DateTime.Now, serviceName);

            var request = new GetMarketReq
            {
                includeCouponLinks = false,
                marketId           = marketId,
                header             = ((BetfairExchangeAPI.APIRequestHeader)GetHeader(false))
            };

            GetMarketResp response = _bfExchangeService[exchangeId].getMarket(request);

            ValidateAPIResponse(serviceName, Convert.ToString(response.header.errorCode),
                                Convert.ToString(response.errorCode), response.header.sessionToken);

            return(response.market);
        }
Пример #2
0
 private static Task<GetMarketResp> CreateGetMarketTask(this BFExchangeServiceClient client, GetMarketReq req)
 {
     return Task<GetMarketResp>.Factory.FromAsync<GetMarketReq>(
         client.BegingetMarket, client.EndgetMarket, req, null);
 }