コード例 #1
0
ファイル: Matchup.cs プロジェクト: Ailuridaes/TournamentAPI
 public void SetResults(MatchupDto matchup)
 {
     Wins   = matchup.Wins;
     Losses = matchup.Losses;
     Ties   = matchup.Ties;
     DidWin = matchup.DidWin;
     DidTie = matchup.DidTie;
 }
コード例 #2
0
        public IActionResult ReportScore(int tournamentId, int matchupId, [FromBody] MatchupDto score)
        {
            if ((score.Player1Score == 0 && score.Player2Score == 0) || score.Player1Score < 0 || score.Player2Score < 0)
            {
                return(BadRequest());
            }

            roundRepository.SetScore(matchupId, score.Player1Score, score.Player2Score);

            return(Ok());
        }