Ejemplo n.º 1
0
        public async Task <IActionResult> PutDeliveryHis(string id, DeliveryHis deliveryHis)
        {
            if (id != deliveryHis.DeliveryHisId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Ejemplo n.º 2
0
        public async Task <ActionResult <DeliveryHis> > PostDeliveryHis(DeliveryHis deliveryHis)
        {
            _context.DeliveryHis.Add(deliveryHis);
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (DeliveryHisExists(deliveryHis.DeliveryHisId))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtAction("GetDeliveryHis", new { id = deliveryHis.DeliveryHisId }, deliveryHis));
        }