public IActionResult GetShipment([FromRoute] int id) { try { if (!_repo.ShipmentExists(id)) { return(NotFound()); } var shipment = Mapper.Map <ShipmentDto>(_repo.GetShipment(id)); return(Ok(shipment)); } catch (Exception ex) { throw new Exception(ex.Message); } }
public async Task UpdateShipmentByIdAsync(string code, FormShipmentModel model) { var entity = _shipmentRepository.GetShipment(model.Id.ToString()); _mapper.Map <FormShipmentModel, Shipment>(model, entity); _shipmentRequestRepository.UpdateShipmentRequest(model.RequestIdList, model.Id); _uow.GetRepository <IShipmentRepository>().Update(entity); await _uow.SaveChangesAsync(); }
public IEnumerable <Shipment> GetShipment() { _log4net.Info("ShipmentController HttpGet "); return(repo.GetShipment()); }