Beispiel #1
0
        public async Task <int> GetUserClientPointsForChallenge(string usuarioId)
        {
            var response = await Policy
                           .Handle <WebException>()
                           .WaitAndRetryAsync
                           (
                retryCount: 5,
                sleepDurationProvider: retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt))
                           )
                           .ExecuteAsync(async() =>
                                         await PottiRomaApiAccess.GetPottiRomaApi <IClientsRefit>().GetUserClientPointsForChallenge(usuarioId)
                                         );

            return(response);
        }
        public async Task <GetGamificationPointsResponse> GetCurrentGamificationPoints()
        {
            var response = await Policy
                           .Handle <WebException>()
                           .WaitAndRetryAsync
                           (
                retryCount: 5,
                sleepDurationProvider: retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt))
                           )
                           .ExecuteAsync(async() =>
                                         await PottiRomaApiAccess.GetPottiRomaApi <IGamificationPointsRefit>().GetCurrentGamificationPoints()
                                         );

            return(response);
        }
        public async Task <User> GetUserByEmail(string email)
        {
            var response = await Policy
                           .Handle <WebException>()
                           .WaitAndRetryAsync
                           (
                retryCount: 5,
                sleepDurationProvider: retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt))
                           )
                           .ExecuteAsync(async() =>
                                         await PottiRomaApiAccess.GetPottiRomaApi <IUserRefit>().GetUserByEmail(email)
                                         );

            return(response);
        }
        public async Task <LoginReponse> Login(LoginRequest request)
        {
            var response = await Policy
                           .Handle <WebException>()
                           .WaitAndRetryAsync
                           (
                retryCount: 5,
                sleepDurationProvider: retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt))
                           )
                           .ExecuteAsync(async() =>
                                         await PottiRomaApiAccess.GetPottiRomaApi <IUserRefit>().Login(request)
                                         );

            return(response);
        }
Beispiel #5
0
        public async Task <GetThophiesByUserIdResponse> GetCurrentTrophies(string usuarioId)
        {
            var response = await Policy
                           .Handle <WebException>()
                           .WaitAndRetryAsync
                           (
                retryCount: 5,
                sleepDurationProvider: retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt))
                           )
                           .ExecuteAsync(async() =>
                                         await PottiRomaApiAccess.GetPottiRomaApi <ITrophiesRefit>().GetCurrentTrophies(usuarioId)
                                         );

            return(response);
        }