public async Task<ActionResult<DeliveryProductType>> PostDeliveryProductType(DeliveryProductType deliveryProductType) { _context.DeliveryProductType.Add(deliveryProductType); await _context.SaveChangesAsync(); return CreatedAtAction("GetDeliveryProductType", new { id = deliveryProductType.DeliveryProductTypeId }, deliveryProductType); }
public async Task<IActionResult> PutDeliveryProductType(int id, DeliveryProductType deliveryProductType) { if (id != deliveryProductType.DeliveryProductTypeId) { return BadRequest(); } _context.Entry(deliveryProductType).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DeliveryProductTypeExists(id)) { return NotFound(); } else { throw; } } return NoContent(); }