Beispiel #1
0
        public ActionResult <SecondaryCustomerShipToAddress> PutSecondaryCustomerShipToAddress(long id, SecondaryCustomerShipToAddress secondaryCustomerShipToAddress)
        {
            if (id != secondaryCustomerShipToAddress.Id)
            {
                return(BadRequest());
            }

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

            try
            {
                _context.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!SecondaryCustomerShipToAddressExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(secondaryCustomerShipToAddress);
        }
Beispiel #2
0
        public ActionResult <SecondaryCustomerShipToAddress> PostSecondaryCustomerShipToAddress(SecondaryCustomerShipToAddress secondaryCustomerShipToAddress)
        {
            _context.SecondaryCustomerShipToAddress.Add(secondaryCustomerShipToAddress);
            _context.SaveChanges();

            return(CreatedAtAction("GetSecondaryCustomerShipToAddress", new { id = secondaryCustomerShipToAddress.Id }, secondaryCustomerShipToAddress));
        }