Ejemplo n.º 1
0
        private async Task GetTestRecsAndBetsJson()
        {
            var eventId = 123;
            var recId   = Guid.Parse("D0E888E1-E0F2-4DE7-9000-0EB6ED0AB9CE");

            var recTable = Table.LoadTable(_client, "Recommendation");
            var rd       = await recTable.GetItemAsync(eventId, recId);

            var rec = RecommendationSerialiser.UnpackRecommendation(rd);

            var betTable = Table.LoadTable(_client, "Bet");
            var bg       = betTable.CreateBatchGet();

            foreach (var betId in rec.BetIds)
            {
                bg.AddKey(rec.EventId, betId);
            }

            await bg.ExecuteAsync();

            var bets = bg.Results.Select(x => x.ToJsonPretty()).ToList();

            foreach (var bet in bets)
            {
                Debug.WriteLine(bet);
            }
        }
Ejemplo n.º 2
0
        private async Task GetTestRecsAndBets()
        {
            var eventId = 123;
            var recId   = Guid.Parse("D0E888E1-E0F2-4DE7-9000-0EB6ED0AB9CE");

            var recTable = Table.LoadTable(_client, "Recommendation");
            var rd       = await recTable.GetItemAsync(eventId, recId);

            var rec = RecommendationSerialiser.UnpackRecommendation(rd);

            var betTable = Table.LoadTable(_client, "Bet");
            var bg       = betTable.CreateBatchGet();

            foreach (var betId in rec.BetIds)
            {
                bg.AddKey(rec.EventId, betId);
            }

            await bg.ExecuteAsync();

            var bets = bg.Results.Select(BetSerialiser.UnpackBet).ToList();

            foreach (var bet in bets)
            {
                Debug.WriteLine($"{bet.EventId}, {bet.BetId}, {bet.Legs.FirstOrDefault()?.Selection?.Price?.PriceType.ToString() ?? "-"}");
            }
        }
Ejemplo n.º 3
0
        private async Task GetTestRecs()
        {
            var recTable = Table.LoadTable(_client, "Recommendation");

            var eventId = 123;
            var recId   = Guid.Parse("D0E888E1-E0F2-4DE7-9000-0EB6ED0AB9CE");

            var doc = await recTable.GetItemAsync(eventId, recId);

            var rec = RecommendationSerialiser.UnpackRecommendation(doc);

            Debug.WriteLine(rec);
        }
Ejemplo n.º 4
0
 private async Task AddRecommendation(Recommendation rec)
 {
     var recTable = Table.LoadTable(_client, "Recommendation");
     await recTable.PutItemAsync(RecommendationSerialiser.PackRecommendation(rec));
 }