コード例 #1
0
        public async Task <IActionResult> PutItemsDetails(int id, ItemsDetails itemsDetails)
        {
            if (id != itemsDetails.Item_Id)
            {
                return(BadRequest());
            }

            _context.Entry(itemsDetails).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ItemsDetailsExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
コード例 #2
0
        public async Task <IActionResult> PutInvoice(int id, Invoice invoice)
        {
            if (id != invoice.Invoice_Id)
            {
                return(BadRequest());
            }

            _context.Entry(invoice).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!InvoiceExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }