Пример #1
0
        public async Task <ResponseObject> GetParticipants(long idTournament)
        {
            var wc      = new AuthHttpClient();
            var reponse = await wc.GetAsync(new Uri(ApiAccess.TournamentUrl + "/" + idTournament + "/participants"));

            return(GetResponseService.TraiteResponse(reponse, new UserDAO(), true));
        }
Пример #2
0
        public async Task <ResponseObject> GetTournament(long idTournament)
        {
            var wc      = new AuthHttpClient();
            var reponse = await wc.GetAsync(new Uri(ApiAccess.TournamentUrl + "/" + idTournament ));

            return(GetResponseService.TraiteResponse(reponse, new TournamentDAO(), false));
        }
Пример #3
0
        public async Task <ResponseObject> GetTournaments()
        {
            var wc      = new AuthHttpClient();
            var reponse = await wc.GetAsync(new Uri(ApiAccess.TournamentUrl));

            return(GetResponseService.TraiteResponse(reponse, new TournamentListDAO(), true));
        }
Пример #4
0
        public async Task <ResponseObject> GetUsersWithAccount()
        {
            var wc      = new AuthHttpClient();
            var reponse = await wc.GetAsync(new Uri(ApiAccess.UsersAccountUrl));

            return(GetResponseService.TraiteResponse(reponse, new UserDAO(), true));
        }
Пример #5
0
        public async Task <ResponseObject> GetClubs()
        {
            var wc       = new AuthHttpClient();
            var response = await wc.GetAsync(new Uri(ApiAccess.ClubUrl));

            var reponse = GetResponseService.TraiteResponse(response, new ClubDAO(), true);

            return(reponse);
        }
Пример #6
0
        public async Task <Tournament> GetTournament(long idTournament)
        {
            var wc = new AuthHttpClient();

            try
            {
                var reponse = await wc.GetAsync(await ApiAccess.GetRessource(ApiAccess.URL.TOURNAMENTS, idTournament));

                return((Tournament)GetResponseService.HandleResponse(reponse, new TournamentDAO(), false));
            }
            catch (HttpRequestException)
            {
                throw new GetDataException();
            }
        }
Пример #7
0
        public async Task <List <User> > GetUsersWithAccount()
        {
            var wc = new AuthHttpClient();

            try
            {
                var reponse = await wc.GetAsync(await ApiAccess.GetRessource(ApiAccess.URL.USER_ACCOUNT));

                var usersDAO = GetResponseService.TraiteResponse(reponse, new UserDAO(), true);
                return(((List <object>)usersDAO).Cast <User>().ToList());
            }
            catch (HttpRequestException)
            {
                throw new GetDataException();
            }
        }
Пример #8
0
        public async Task <List <User> > GetParticipants(long idTournament)
        {
            var wc = new AuthHttpClient();

            try
            {
                var reponse = await wc.GetAsync(await ApiAccess.GetRessource(ApiAccess.URL.PARTICIPANTS, idTournament));

                var usersDao = GetResponseService.HandleResponse(reponse, new UserDAO(), true);
                return(((List <Object>)usersDao).Cast <User>().ToList());
            }
            catch (HttpRequestException)
            {
                throw new GetDataException();
            }
        }
Пример #9
0
        public async Task <List <Tournament> > GetTournaments()
        {
            var wc = new AuthHttpClient();

            try
            {
                var reponse = await wc.GetAsync(await ApiAccess.GetRessource(ApiAccess.URL.TOURNAMENTS));

                var tournamentDAO = GetResponseService.HandleResponse(reponse, new TournamentListDAO(), true);
                return(((List <Object>)tournamentDAO).Cast <Tournament>().ToList());
            }
            catch (HttpRequestException)
            {
                throw new GetDataException();
            }
        }
Пример #10
0
        public async Task <List <Club> > GetClubs()
        {
            var wc = new AuthHttpClient();

            try
            {
                var response = await wc.GetAsync(await ApiAccess.GetRessource(ApiAccess.URL.CLUBS));

                var clubsDao = GetResponseService.HandleResponse(response, new ClubDAO(), true);
                return(((List <object>)clubsDao).Cast <Club>().ToList());
            }
            catch (HttpRequestException)
            {
                throw new GetDataException();
            }
        }