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