Dev2.Converters.Dev2BaseConversionBroker.Convert C# (CSharp) Method

Convert() public method

public Convert ( string payload ) : string
payload string
return string
        public string Convert(string payload)
        {
            string result;

            // convert from to base type
            if (_from.IsType(payload))
            {
                byte[] rawBytes = _from.NeutralizeToCommon(payload);

                // convert to expected type
                result = _to.ConvertToBase(rawBytes);
            }
            else
            {
                //throw new ConversionException - wrong base format
                throw new BaseTypeException("Base Conversion Broker was expecting [ " + _from.HandlesType() +
                                            " ] but the data was not in this format");
            }

            return result;
        }
    }
Dev2BaseConversionBroker