public async Task <ActionResult> UpdateTeam() { TeamApiModel model = new TeamApiModel(); model.Title = "Team 100"; model.TeamID = 1; var allteam = await client.Update(model); return(View()); }
public Mannschaft Map(TeamApiModel apiModel) { var result = new Mannschaft { TeamId = apiModel.TeamId, Kurzname = apiModel.TeamName, Vereinsnummer = apiModel.ClubCode, Langname = apiModel.ClubName }; return(result); }
public async Task Post_ReturnsOkResult_WhenModelIsValid() { var userId = Guid.NewGuid(); SetupRequestHeader(_sut, userId); var model = new TeamApiModel { Owner = new UserApiModel { Id = userId } }; var result = await _sut.Post(model); Assert.IsType(typeof(OkObjectResult), result); }
public async Task <IActionResult> Post([FromBody] TeamApiModel teamApiModel) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } teamApiModel.Owner = await GetRemoteUserAsync(teamApiModel.Owner.Id); var teamDto = _mapper.Map <TeamDto>(teamApiModel); var id = await _teamService.CreateAsync(CurrentUserId, teamDto); _logger.LogInformation($"New team {teamApiModel.Name} was created"); return(Ok(id)); }
public async Task <IActionResult> Create(TeamViewModel model) { if (!ModelState.IsValid) { return(RedirectToAction("Board", "Ticket")); } var team = new TeamApiModel { Name = model.Name, Owner = new UserApiModel { Id = User.GetUserId() } }; var id = await _communicationService.PostAsync <string, TeamApiModel>("user/teams", team, FormHeaders(JsonType), "teamapi"); return(RedirectToAction("Board", "Ticket", new { teamId = new Guid(id) })); }
public async Task <TeamResponse.UpdateResponse> Update(TeamApiModel model) { var response = await PutEncodedContentWithSimpleResponse <TeamResponse.UpdateResponse, DefaultResponseApiModel, TeamApiModel>(generalUri, model); return(response); }
public async Task <TeamApiModel> CreateUpdateTeam(TeamApiModel team) { var response = await ApiClient.PostJsonEncodedContent(CreateUpdateTeamUri, team); return(await DecodeContent <TeamApiModel>(response)); }