private async Task GetName() { var values = await _competitionStatsClient.GetCompetitions(); CompetitionName = values.AsEnumerable().First( kv => kv.Value == CompetitionId).Key; }
public async Task OnPostResult(Result result) { Result = result; if (ModelState.IsValid) { result.CompetitionId = _competitionStatsClient.GetCompetitions().Result[result.Competition]; result.TeamId = _competitionStatsClient.GetTeams().Result[result.Team]; var json = Utilities.GetJSON(result); var response = await _competitionStatsClient.AddResult(json); if (response.StatusCode != System.Net.HttpStatusCode.Created) { ModelState.AddModelError("Result.Team", response.ReasonPhrase); } else { Response.Redirect("AddResults"); } } }