public async Task <ActionResult <ShipmentBags> > PostShipmentBags(ShipmentBags shipmentBags) { _context.ShipmentBags.Add(shipmentBags); await _context.SaveChangesAsync(); return(CreatedAtAction("GetShipmentBags", new { id = shipmentBags.Id }, shipmentBags)); }
public async Task <IActionResult> PutShipmentBags(Guid id, ShipmentBags shipmentBags) { if (id != shipmentBags.Id) { return(BadRequest()); } _context.Entry(shipmentBags).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ShipmentBagsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }