Exemplo n.º 1
0
        public async Task <IActionResult> PutPlayer(int id, Player player)
        {
            if (id != player.Id)
            {
                return(BadRequest());
            }

            _context.Entry(player).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!PlayerExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Exemplo n.º 2
0
 public async Task <int> SaveChangesAsync()
 {
     return(await Db.SaveChangesAsync());
 }