public async Task <IActionResult> PutCustomers(string id, Customers customers) { if (id != customers.CustomerId) { return(BadRequest()); } _context.Entry(customers).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CustomersExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutEmployees(int id, Employees employees) { if (id != employees.EmployeeId) { return(BadRequest()); } _context.Entry(employees).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EmployeesExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }