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() ?? "-"}"); } }
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); } }
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); }