// PUT: api/Customer/5 // To protect from overposting attacks, enable the specific properties you want to bind to, for // more details, see https://go.microsoft.com/fwlink/?linkid=2123754. //[HttpPut("{id}")] public async Task <IActionResult> PutCustomer(Customer customer) { //if (id != customer.CusId) //{ // return BadRequest(); //} _context.Entry(customer).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CustomerExists(customer.CusId)) { return(NotFound()); } else { throw; } } return(NoContent()); }
// PUT: api/Product/5 // To protect from overposting attacks, enable the specific properties you want to bind to, for // more details, see https://go.microsoft.com/fwlink/?linkid=2123754. //[HttpPut("{id}")] public async Task <IActionResult> PutProduct(Product product) { //if (id != product.ProductId) //{ // return BadRequest(); //} _context.Entry(product).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductExists(product.ProductId)) { return(NotFound()); } else { throw; } } return(NoContent()); //return new JsonResult("Success"); }
// PUT: api/Store/5 // To protect from overposting attacks, enable the specific properties you want to bind to, for // more details, see https://go.microsoft.com/fwlink/?linkid=2123754. //[HttpPut("{id}")] public async Task <IActionResult> PutStore(Store store) { //if (id != store.StoreId) //{ // return BadRequest(); //} _context.Entry(store).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StoreExists(store.StoreId)) { return(NotFound()); } else { throw; } } return(NoContent()); }