Esempio n. 1
0
        public override async Task <FetchChallengePayoutsResponse> FetchChallengePayouts(FetchChallengePayoutsRequest request, ServerCallContext context)
        {
            var challenges = await _challengeQuery.FetchChallengesAsync();

            var response = new FetchChallengePayoutsResponse
            {
                Payouts =
                {
                    _mapper.Map <IEnumerable <ChallengePayoutDto> >(challenges)
                }
            };

            return(context.Ok(response));
        }
Esempio n. 2
0
        public override async Task <FetchChallengesResponse> FetchChallenges(FetchChallengesRequest request, ServerCallContext context)
        {
            var challenges = await _challengeQuery.FetchChallengesAsync(
                request.Game.ToEnumerationOrNull <Game>(),
                request.State.ToEnumerationOrNull <ChallengeState>(),
                request.IncludeMatches);

            var response = new FetchChallengesResponse
            {
                Challenges =
                {
                    challenges.Select(ChallengeProfile.Map)
                }
            };

            return(context.Ok(response));
        }