public async Task <IActionResult> PutWords([FromRoute] int id, [FromBody] Words words) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != words.id) { return(BadRequest()); } _context.Entry(words).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WordsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }