Exemplo n.º 1
0
        public async Task <Player2[]> GetPlayerInfo(int matchid, int userteamid, Object utoken)
        {
            // var data = await httpClient.GetJsonAsync<Player[]>($"{CommanUrl.url}UserTeam/GetallPlayers/0/{matchid}");
            // var data = await BlazorHttpExtensions.GetJsonAsync<Player[]>(this.httpClient,$"{CommanUrl.url}UserTeam/GetallPlayers/0/{matchid}",utoken.ToString());
            var data = await BlazorHttpExtensions.GetJsonAsync <Player2[]>(this.httpClient, $"{CommanUrl.url}UserTeam/UserTeamPlayers/{userteamid}/{matchid}", utoken.ToString());

            return(data);
        }
Exemplo n.º 2
0
 public async Task JoinContest(UserContest contests, Object utoken)
 {
     try
     {
         await BlazorHttpExtensions.PostJsonAsync <UserContest>(httpClient, $"{CommanUrl.url}UserTeam", contests, utoken.ToString());
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
        public async Task SaveTeam(UserTeam players, Object utoken)
        {
            try
            {
                await BlazorHttpExtensions.PostJsonAsync <UserTeam>(_httpClient, $"{CommanUrl.url}UserTeam", players, utoken.ToString());

                Console.WriteLine("Ok");
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
        public async Task <UserTeams[]> GetUserTeams(int matchid, Object utoken)
        {
            try
            {
                var data = await BlazorHttpExtensions.GetJsonAsync <UserTeams[]>(this._httpClient, $"{CommanUrl.url}UserTeam/matchUserTeam/{matchid}", utoken.ToString());

                return(data);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                return(null);
            }
        }
Exemplo n.º 5
0
        public async Task <Login> UserLoginAsync(Login login)
        {
            try
            {
                //var data = await httpClient.PostJsonAsync<Register>($"{CommanUrl.url}Account", login);
                Login _login = await BlazorHttpExtensions.PostJsonAsync <Login>(httpClient, $"{CommanUrl.url}Account", login, string.Empty);

                return(_login);
            }
            catch (Exception ex)
            {
                //Console.WriteLine(ex.Message);
                var data = new Login();
                return(data);
            }
        }
Exemplo n.º 6
0
        public async Task <List <Player2> > GetPlayerData(int matchid, int userTeamId, Object utoken)
        {
            var data = await BlazorHttpExtensions.GetJsonAsync <List <Player2> >(this.httpClient, $"{CommanUrl.url}UserTeam/UserTeamPlayers/{userTeamId}/{matchid}", utoken.ToString());

            return(data);
        }