Exemple #1
0
        public async Task <IActionResult> Put(int id, Tournament tournament)
        {
            if (id != tournament.TournamentId)
            {
                return(BadRequest());
            }
            _db.Entry(tournament).State = EntityState.Modified;

            try
            {
                await _db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TournamentExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }
            return(NoContent());
        }
        public async Task <IActionResult> Put(int id, Match match)
        {
            if (id != match.MatchId)
            {
                return(BadRequest());
            }

            try
            {
                _db.Entry(match).State = EntityState.Modified;
                await _db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!MatchExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }
            return(NoContent());
        }