public async Task <IActionResult> PutButton(int id, Button button) { if (id != button.ID) { return(BadRequest()); } _context.Entry(button).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ButtonExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }