Exemplo n.º 1
0
        public async Task <Application.TeamLeagueMatches.Commands.UpdateTeamLeagueMatchSubstitution.SubstitutionDto> UpdateTeamLeagueMatchSubstitution(
            string leagueName, Guid matchGuid, string teamName, Guid substitutionGuid,
            UpdateTeamLeagueMatchSubstitutionDto dto)
        {
            var response = await httpRequestFactory.Put(
                $"{teamLeagueApiUrl}/{leagueName}/matches/{matchGuid}/matchEntries/{teamName}/substitutions/{substitutionGuid}",
                dto
                );

            if (response.IsSuccessStatusCode)
            {
                var settings = new JsonSerializerSettings
                {
                    Converters =
                    {
                        new JsonInterfaceConverter <Application.TeamLeagueMatches.Commands.UpdateTeamLeagueMatchSubstitution.SubstitutionDto, ISubstitutionDto>(),
                        new JsonInterfaceConverter <Application.TeamLeagueMatches.Commands.UpdateTeamLeagueMatchSubstitution.PlayerDto,       IPlayerDto>()
                    }
                };

                return(response.ContentAsType <Application.TeamLeagueMatches.Commands.UpdateTeamLeagueMatchSubstitution.SubstitutionDto>(settings));
            }

            return(null);
        }
        public async Task <IActionResult> UpdateMatchSubstitution(string leagueName, Guid matchGuid, string teamName, Guid substitutionGuid, UpdateTeamLeagueMatchSubstitutionDto dto)
        {
            var sub = await competitionApi.UpdateTeamLeagueMatchSubstitution(
                leagueName,
                matchGuid,
                teamName,
                substitutionGuid,
                dto
                );

            return(PartialView("ViewSubstitutionMatchEvent", sub));
        }