public async Task <ActionResult <BagParcels> > PostBagParcels(BagParcels bagParcels) { _context.BagParcels.Add(bagParcels); await _context.SaveChangesAsync(); return(CreatedAtAction("GetBagParcels", new { id = bagParcels.Id }, bagParcels)); }
public async Task <IActionResult> PutBagParcels(Guid id, BagParcels bagParcels) { if (id != bagParcels.Id) { return(BadRequest()); } _context.Entry(bagParcels).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BagParcelsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }