Exemplo n.º 1
0
        /// <inheritdoc />
        async Task <Match> IRepository <Matchup, Match> .FindAsync(Matchup identifier, CancellationToken cancellationToken)
        {
            string matchId = identifier != null ? identifier.MatchId : null;
            var    request = new MatchDetailsRequest
            {
                MatchId = matchId
            };
            var response = await this.serviceClient.SendAsync <MatchDTO>(request, cancellationToken).ConfigureAwait(false);

            if (response.Content == null)
            {
                return(null);
            }

            return(this.matchConverter.Convert(response.Content, response));
        }
Exemplo n.º 2
0
        /// <inheritdoc />
        Match IRepository <Matchup, Match> .Find(Matchup identifier)
        {
            string matchId = identifier != null ? identifier.MatchId : null;
            var    request = new MatchDetailsRequest
            {
                MatchId = matchId
            };
            var response = this.serviceClient.Send <MatchDTO>(request);

            if (response.Content == null)
            {
                return(null);
            }

            return(this.matchConverter.Convert(response.Content, null));
        }
Exemplo n.º 3
0
        /// <inheritdoc />
        Task <Match> IRepository <Matchup, Match> .FindAsync(Matchup identifier, CancellationToken cancellationToken)
        {
            string matchId = identifier != null ? identifier.MatchId : null;
            var    request = new MatchDetailsRequest
            {
                MatchId = matchId
            };

            return(this.serviceClient.SendAsync <MatchDataContract>(request, cancellationToken).ContinueWith(task =>
            {
                var response = task.Result;
                if (response.Content == null)
                {
                    return null;
                }

                return this.converterForMatch.Convert(response.Content, null);
            }, cancellationToken));
        }