public async Task <IActionResult> PutSupplier(int id, Supplier supplier) { if (id != supplier.SupplierId) { return(BadRequest()); } _context.Entry(supplier).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SupplierExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }