ConvertToValue method

Object? ConvertToValue(
  1. String? stringValue
)
Converts a String to value consistent with type. String to convert to a value.

Implementation

Object? ConvertToValue(String? stringValue) {
  try {
    return Parse(stringValue);
  } on FormatException {
    throw ServiceXmlDeserializationException(
      "The value '$stringValue' couldn't be converted to type $Type.",
    );
  } on ArgumentException {
    throw ServiceXmlDeserializationException(
      "The value '$stringValue' couldn't be converted to type $Type.",
    );
  }
}