public async Task Add(TeamAddModel team) { await repository.Add(new KadabraTeam() { CountryId = team.CountryId, ImageFlag = team.ImageFlag, Name = team.Name, TeamKey = team.TeamKey, Id = Guid.NewGuid().ToString() }); await repository.Save(); }
private TeamAddModel GetAddData() { var model = new TeamAddModel { Command = new AddTeamCommand() { Season = enuSeason.s2017_2018, Category = enuCategory.CMV } }; return(model); }
public async Task <ActionResult> AddTeam(TeamAddModel team) { if (ModelState.IsValid) { await teamService.Add(team); return(RedirectToAction("Index")); } else { var model = await teamService.GetTeamWithCountries(); return(View("Add", model)); } }
public async Task <IHttpActionResult> AddTeam(TeamAddModel team) { if (!ModelState.IsValid) { return(this.InternalServerError()); } try { await services.Add(team); return(Ok()); } catch (Exception ex) { return(InternalServerError(ex)); } }
public async Task Add(TeamAddModel team) { HttpResponseMessage response = await apiClient.PostAsJsonAsync("Kadabra/Team/AddTeam", team); response.EnsureSuccessStatusCode(); }