public CargoRoutingDTO LoadCargoForRouting(string trackingId) { try { Cargo cargo = CargoRepository.Find(new TrackingId(trackingId)); var assembler = new CargoRoutingDTOAssembler(); return(assembler.ToDTO(cargo)); } catch (Exception exception) { throw new NDDDRemoteBookingException(exception.Message); } }
public CargoRoutingDTO LoadCargoForRouting(string trackingId) { try { Cargo cargo = CargoRepository.Find(new TrackingId(trackingId)); var assembler = new CargoRoutingDTOAssembler(); return assembler.ToDTO(cargo); } catch (Exception exception) { throw new NDDDRemoteBookingException(exception.Message); } }
public IList <CargoRoutingDTO> ListAllCargos() { try { IList <Cargo> cargoList = CargoRepository.FindAll(); var dtoList = new List <CargoRoutingDTO>(cargoList.Count); var assembler = new CargoRoutingDTOAssembler(); foreach (Cargo cargo in cargoList) { dtoList.Add(assembler.ToDTO(cargo)); } return(dtoList); } catch (Exception exception) { throw new NDDDRemoteBookingException(exception.Message); } }
public IList<CargoRoutingDTO> ListAllCargos() { try { IList<Cargo> cargoList = CargoRepository.FindAll(); var dtoList = new List<CargoRoutingDTO>(cargoList.Count); var assembler = new CargoRoutingDTOAssembler(); foreach (Cargo cargo in cargoList) { dtoList.Add(assembler.ToDTO(cargo)); } return dtoList; } catch (Exception exception) { throw new NDDDRemoteBookingException(exception.Message); } }