public ShipmentType UpdateShipmentType(ShipmentType shipmentType) {

            _shipmentTypeRepository.Edit(shipmentType);
            _shipmentTypeRepository.Save();

            return shipmentType;
        }
        internal static ShipmentType ToShipmentType(
            this ShipmentTypeRequestModel requestModel, 
            ShipmentType existingShipmentType) {

            existingShipmentType.Name = requestModel.Name;
            existingShipmentType.Price = requestModel.Price.Value;

            return existingShipmentType;
        }
        public OperationResult<ShipmentType> AddShipmentType(ShipmentType shipmentType) {

            // If there is already one which has the same name,
            // return unseccessful result back
            if (_shipmentTypeRepository.GetSingleByName(shipmentType.Name) != null) {

                return new OperationResult<ShipmentType>(false);
            }

            shipmentType.Key = Guid.NewGuid();
            shipmentType.CreatedOn = DateTime.Now;

            _shipmentTypeRepository.Add(shipmentType);
            _shipmentTypeRepository.Save();

            return new OperationResult<ShipmentType>(true) { 
                Entity = shipmentType
            };
        }