public async Task <IActionResult> PutCustomers(int id, Customers customers) { if (id != customers.CustomerNumber) { 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> PutBrands(int id, Brands brands) { if (id != brands.BrandId) { return(BadRequest()); } _context.Entry(brands).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BrandsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutProducts(int id, Products products) { if (id != products.ProductCode) { return(BadRequest()); } _context.Entry(products).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }