//[Route("id")] public async Task <IActionResult> PutEmployee(int id, Employee employee) { if (id != employee.Id) { return(BadRequest()); } _context.Entry(employee).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EmployeeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public TestTable UpdateTestTable(TestTable testtable) { testApiDbContext.Entry(testtable).State = EntityState.Modified; testApiDbContext.SaveChanges(); return(testtable); }