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()); }
public async Task <ActionResult <DeliveryProductState> > PostDeliveryProductState(DeliveryProductState deliveryProductState) { _context.DeliveryProductState.Add(deliveryProductState); await _context.SaveChangesAsync(); return(CreatedAtAction("GetDeliveryProductState", new { id = deliveryProductState.DeliveryProductStateId }, deliveryProductState)); }