public async Task <IActionResult> PutUsersTest(int usersTestId, UsersTest usersTest) { if (usersTestId != usersTest.Id) { return(BadRequest()); } _context.Entry(usersTest).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UsersTestExists(usersTestId)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutTest(int testId, Test test) { if (testId != test.Id) { return(BadRequest()); } _context.Entry(test).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TestExists(testId)) { return(StatusCode(404)); } else { throw; } } return(NoContent()); }