public async Task <IActionResult> UpdateTeamLeagueMatch(string leagueName, Guid guid, UpdateTeamLeagueMatchDto dto)
        {
            var match = await competitionApi.UpdateTeamLeagueMatch(
                new UpdateTeamLeagueMatchCommand
            {
                LeagueName = WebUtility.HtmlDecode(leagueName),
                Guid       = guid,
                HomeTeam   = dto.HomeTeam,
                AwayTeam   = dto.AwayTeam,
                StartTime  = dto.StartTime
            });

            return(PartialView("ViewMatch", match));
        }
示例#2
0
        public async Task <IActionResult> UpdateTeamLeagueMatch(string name, string guid, [FromBody] UpdateTeamLeagueMatchDto dto)
        {
            try
            {
                var command = mapper.Map <UpdateTeamLeagueMatchCommand>(dto, opt =>
                {
                    opt.Items["leagueName"] = name;
                    opt.Items["guid"]       = guid;
                });

                var match = await mediator.Send(command);

                return(Ok(match));
            }
            catch (LeagueManagerException ex)
            {
                return(BadRequest(ex.Message));
            }
            catch
            {
                return(BadRequest("Something went wrong!"));
            }
        }