Exemple #1
0
    public static async Task <HeadResultInfo> GetHeadResultInfo(int matchId)
    {
        HeadResultInfo matchResult = await Try(
            $"HeadResultInfo-{matchId}.json",
            () => Client.GetHeadResultInfo(matchId));

        return(matchResult);
    }
Exemple #2
0
    public static async Task <BitsMatchResult> GetBitsMatchResult(this IBitsClient client, int matchId)
    {
        Task <MatchResults>   matchResultsTask   = client.GetMatchResults(matchId);
        Task <MatchScores>    matchScoresTask    = client.GetMatchScores(matchId);
        Task <HeadResultInfo> headResultInfoTask = client.GetHeadResultInfo(matchId);
        Task <HeadInfo>       headInfoTask       = client.GetHeadInfo(matchId);

        await Task.WhenAll(matchResultsTask, matchScoresTask, headResultInfoTask, headInfoTask);

        MatchResults   matchResults   = await matchResultsTask;
        MatchScores    matchScores    = await matchScoresTask;
        HeadResultInfo headResultInfo = await headResultInfoTask;
        HeadInfo       headInfo       = await headInfoTask;

        return(new BitsMatchResult(matchResults, matchScores, headResultInfo, headInfo));
    }