Exemple #1
0
        public IActionResult SetMatchOutcome([FromBody] JObject matchOutcomeObject)
        {
            var matchId       = matchOutcomeObject["matchId"].ToObject <int>();
            var outcome       = matchOutcomeObject["outcome"].ToObject <int>();
            var wasOutcomeSet = _matchRepository.SetMatchOutcome(matchId, outcome);

            if (!wasOutcomeSet)
            {
                return(Forbid());
            }
            _ticketRepository.CheckWinningLosingTickets(matchId);
            return(Ok(true));
        }