public async Task <Shipment> FinalizeShipment(string id) { var shipment = await _shipmentRepository.GetShipmentById(id); shipment.isFinalized = true; return(await _shipmentRepository.Update(shipment)); }
public IActionResult Update(int id, [FromBody] JsonPatchDocument <Shipment> shipmentPatch) { Shipment shipment = _shipmentRepository.GetOne(id); if (shipment == null) { NotFound(); } shipmentPatch.ApplyTo(shipment); _shipmentRepository.Update(shipment); return(Ok()); }
public IHttpActionResult PutShipment(int id, ShipmentsModel shipment) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != shipment.ShipmentId) { return(BadRequest()); } Shipment dbShipment = _shipmentRepository.GetById(id); dbShipment.Update(shipment); _shipmentRepository.Update(dbShipment); try { _unitOfWork.Commit(); } catch (Exception) { if (!ShipmentExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public override void Update(ShipmentEntity shipmentEntity) { shipmentEntity.UpdatedDate = DateTime.Now; _shipmentRepository.Update(shipmentEntity); }
public Shipment Update(Shipment ShipmentUpdate) { return(ShipmentRepo.Update(ShipmentUpdate)); }