예제 #1
0
        public async Task <IActionResult> PutDeliveryProductState(int id, DeliveryProductState deliveryProductState)
        {
            if (id != deliveryProductState.DeliveryProductStateId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
예제 #2
0
        public async Task <ActionResult <DeliveryProductState> > PostDeliveryProductState(DeliveryProductState deliveryProductState)
        {
            _context.DeliveryProductState.Add(deliveryProductState);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetDeliveryProductState", new { id = deliveryProductState.DeliveryProductStateId }, deliveryProductState));
        }