Exemplo n.º 1
0
        public ActionResult AddMatch(AddNewMatchChoices model, int leagueId)
        {
            Match match   = model.Match;
            int   matchId = MatchService.AddNewMatch(match, leagueId, match.HomeTeam.Id, match.AwayTeam.Id);

            return(RedirectToAction("AddDetailsForMatch", new { id = matchId }));
        }
        public IActionResult StartMatch([FromBody] MatchCreateModel model)
        {
            if (model == null)
            {
                return(BadRequest("Model is missing"));
            }
            if (model.GameId is null or 0)
            {
                return(BadRequest("Invalid Game"));
            }
            var matchId = _service.AddNewMatch(model);
            var match   = _service.GetMatch(matchId);

            return(Ok(match));
        }