Пример #1
0
        public static List <SingleMarket> Run(
            [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
            ILogger log, ExecutionContext context)
        {
            log.LogInformation("BFBuildMulti BetFair API accessed, Date:" + new DateTime().ToString());
            ICacheManager <MultiBuilder> cacheManager = new CacheManager <MultiBuilder>();
            var marketEngine = new MarketEngine();
            var eventId      = req.Query["eventId"].ToString();

            //check if already saved
            var markets = marketEngine.GeAllForEvent(eventId);

            if (markets != null && markets.Count > 0)
            {
                return(markets);
            }
            else
            {
                var apiConfig          = new ApiConfig(context);
                var muiltBuilderEngine = new MuiltBuilderEngine(apiConfig);
                var marketfilter       = new CustomMarketFilter()
                {
                    EventIds = new HashSet <string> {
                        eventId
                    },
                    MarketTypes = new HashSet <string> {
                        "MATCH_ODDS", "OVER_UNDER_25", "OVER_UNDER_15"
                    },
                    Count = 5
                };
                return(muiltBuilderEngine.Execute(marketfilter, false).Markets.ToList());
            }
        }
Пример #2
0
    void Start()
    {
        //Make Singleton!
        new GameModel();

        //Grab references!
        myMarket    = GetComponent <MarketEngine>();
        myMarketGUI = GetComponentInChildren <MarketGUI>();

        //Update Market Prices
        updateMarketGUI();
    }