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); }
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); } }
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); } }
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); }