public async Task <IActionResult> PutRoom(int id, Room room) { if (id != room.RoomId) { return(BadRequest()); } _context.Entry(room).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RoomExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutMessage(int id, Message message) { if (id != message.MessageId) { return(BadRequest()); } _context.Entry(message).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MessageExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutPlayer(int id, Player player) { if (id != player.PlayerId) { return(BadRequest()); } _context.Entry(player).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PlayerExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }